This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Bar script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
l
l.kleijn
Voice
Posts: 33
Joined: Sun May 18, 2014 10:02 am

Bar script

Post by l.kleijn »

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
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
l
l.kleijn
Voice
Posts: 33
Joined: Sun May 18, 2014 10:02 am

Post by l.kleijn »

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]"
}
The people get money when they join. in a txt file
Post Reply