#Set the channel for this script to work on
set gamechan "#channel"
#Set the time 'in seconds' after how long to check for voiced users.
set gametimer "1"
bind pub n "!start" start:game
proc start:game {nick uhost hand chan text} {
global botnick gamechan
set voices 0
foreach user [chanlist $gamechan] {
if {![isop $user $gamechan] && ![isvoice $user $gamechan] && ![isbotnick $user] && [botisop $gamechan]} {
pushmode $gamechan +v $user
incr voices
}
}
flushmode $gamechan
set time [unixtime]; set timenow [ctime $time]
putserv "TOPIC $gamechan :New compo started on [string trim [lindex $timenow 2]] [string trim [lindex $timenow 1]] [string trim [lindex $timenow 3]] with $voices voiced clients."
}
utimer $gametimer check:voices
proc check:voices { } {
global gamechan
set voices 0
set winner "none"
foreach user [chanlist $gamechan] {
if {[isvoice $user $gamechan] && ![isbotnick $user]} {
inc voices
}
}
if {$voices == 1} {
foreach user [chanlist $gamechan] {
if {[isvoice $user $gamechan] && ![isbotnick $user]} {
set winner $user
break
}
}
putserv "privmsg $gamechan :$winner is the winner!!"
return 0
}
if {$voices == 0} {
putserv "privmsg $gamechan :ERROR: No voiced user left!"
putserv "privmsg $gamechan :Game stopped."
return 0
}
utimer $gametimer check:voices
}
i have found this script in this forum but it doesnt work.. can someone pls fix it and post it here? the bot voices all users with !start and sets a topic..
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
When you start the script it should count how many voices there are in the channel.
See if that works. if it does then i dont know why $voices reports it as 0 .If it doesn't then we will have to look at it again.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born