I'm searching for a script that if you say --> .pay cola <-- and the price is 1,50
and you have more money that it give cola so i need a script for this and then if you have 1,50 equal or higher that you can get it
Code: Select all
proc pub:pay {nick host hand chan arg} {
global botnick
set searchstring $arg
set fname "bar.txt"
set fp [open $fname "r"]
set data [read -nonewline $fp]
close $fp
if {[string match *topic* [join $line]]} {
lappend searchresult $line
}
if {[topic == "[lindex [split [join $searchresult] "|"] 0]"} {
putserv "PRIVMSG Fujin :De prijs van de topic verandering is [lindex [split [join $searchresult] "|"] 1]"
}
set product [lindex $arg 0 end]
set topic [lrange $arg 1 end]
if {$product == "topic"} {
if {[string tolower [lindex [split [join $$searchresult] "|"] 1]} {
putserv "NOTICE $nick :You don't have enough money"
return 0
}
set topicpay [lindex [split [join $searchresult] "|"] 1]
set searchresult2 $arg
set fname2 "money.txt"
set fp2 [open $fname2 "r"]
set data2 [read -nonewline $fp2]
close $fp2
if {[string match *$topicpay* [join $line2]]} {
lappend searchresult2 $line2
}
putserv "PRIVMSG $nick :Calc $topicpay - [lindex [split [join $searchresult2] "|"] 1]"
}