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.

! on another way !

Old posts that have not been replied to for several years.
Locked
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

! on another way !

Post by AbuAli »


hello. how can i do the same job on another way.. like read the lines from a file coca.txt not random .. when user say !coca say the first line on coca.txt .. when other user say !coca again say the second line on the coca.txt

Code: Select all

set trigger "!" 
set coca "coca"
proc char {} {
  global trigger
  return $trigger
}
proc coca {} {
  global coca
  return $coca
}
bind pub - "[char]coca" pub_coca
proc pub_coca {nick uhost hand chan arg} {
  global coca2 botnick channel
   set coca [lindex $coca2 [rand [llength $coca2]]]
   putserv "PRIVMSG $chan :$nick $coca "
}
set coca2 {
     "need to drink one?"
     "me 2 like it."
}
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Look here
Locked