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.

Uptime Contest script

Old posts that have not been replied to for several years.
Locked
D
Diablo
Voice
Posts: 12
Joined: Mon May 02, 2005 6:24 am

Uptime Contest script

Post by Diablo »

#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..

pls help
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

find this in the script

Code: Select all

inc voices
and change it to this

Code: Select all

incr voices
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
D
Diablo
Voice
Posts: 12
Joined: Mon May 02, 2005 6:24 am

Post by Diablo »

ok thnx.. bot now changes topic but it says that there is 0 voice clients:/
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

I cant see anything wrong with it lets try to debug it.

put this above the first incr voices

Code: Select all

 putserv "privmsg $gamechan :$voices" 
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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

You'd be smarter to make it count on part / sign because a 1 second timer is just nasty :p
Locked