Code: Select all
- New compo started 01-03-2005 @ 22:56 CET with 76 users)Code: Select all
- New compo started 01-03-2005 @ 22:56 CET with 76 users)Code: Select all
#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
}
Code: Select all
New compo started at 01-03-2005 22:00 CEST with 231 voiced clients Code: Select all
if {$foo} {
# something
} else {
# something else
}
Code: Select all
(01:49:19) (@FuE-) !start
(01:49:19) —› topic: (_aLexi) changes topic to (New compo started on 19 Mar 01:49:19 with 0 voiced clients.)