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."
}