| View previous topic :: View next topic |
| Author |
Message |
l.kleijn Voice
Joined: 18 May 2014 Posts: 33
|
Posted: Sun Jan 06, 2019 1:30 pm Post subject: Bar script |
|
|
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Jan 07, 2019 3:53 am Post subject: |
|
|
You will have to provide more info if want to see any results. For example how do you get the money in the fist place? What other stuff you want to "sell" ? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
l.kleijn Voice
Joined: 18 May 2014 Posts: 33
|
Posted: Mon Jan 07, 2019 8:20 am Post subject: |
|
|
| Code: |
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]"
}
|
The people get money when they join. in a txt file |
|
| Back to top |
|
 |
|