Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Tue Jul 14, 2009 8:06 am Post subject: be_acro bug |
|
|
Hi,
be_acro.tcl allows voting before the game (play round) is finished, so it makes the script unusable.
I think here it's the problem:
| Code: | putmsg $chan "Time is up!"
if {$totacro > 2} {
set fs [open $acrovotes w+]
|
This makes possible start voting once 3 acros are submitted instead of allowing it after acro time is over. How to fix it?
Author's note about the script :
| Quote: | # THIS IS BUGFREE CODE !!!!!!! IF YOU FIND BUGS IT IS BECAUSE I PUT
# THEM IN ON PURPOSE !! IT'S NOT A BUG! TRUST ME! |
Well, here it's the whole acro end round proc: | Code: | proc acroendround {chan} {
global acrovotes acrocurrent acropeople acrorunning botnick acrotimerid
set fo [open $acropeople r]
set totacro -1
while {![eof $fo]} {
gets $fo _temp
incr totacro
}
putmsg $chan "Time is up!"
if {$totacro > 2} {
set fs [open $acrovotes w+]
close $fs
set fa [open $acrocurrent w+]
close $fa
putmsg $chan "\002Current Acros:\002"
set fs [open $acropeople r]
set acnt 1
while {![eof $fs]} {
set acro(line) [lrange [split [gets $fs] " "] 1 end]
if {$acro(line) != ""} {
set numbah "\002\[$acnt\]\002 \0039,1"
putmsg $chan "$numbah $acro(line) "
}
incr acnt 1
}
set totalacros -1
set fs [open $acropeople r]
while {![eof $fs]} {
gets $fs temp_
incr totalacros 1
}
close $fs
set votesecs [expr ((30 + (($totalacros -3) * 5)) + ($totalacros * 2)) + 4]
putmsg $chan "Start voting !! You have \002[expr ($votesecs - ($totalacros * 2)) -4]\002 seconds. Use the form \037/MSG $botnick NUMBER\037 to submit a vote."
bind msgm -|- * acro:msg
set acrotimerid [utimer [expr $votesecs -10] "acrowarningvote $chan"]
} else {
putmsg $chan "Sorry, not enough players this round! New round starts in 15 seconds."
unbind msgm -|- * acro:msg
set fp [open $acrocurrent w+]
close $fp
set acrotimerid [utimer 15 "startacro ooga ooga ooga $chan newround"]
set acrorunning 0
}
}
|
|
|