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.

be_acro bug

Support & discussion of released scripts, and announcements of new releases.
Post Reply
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

be_acro bug

Post by Torrevado »

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: Select all

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 :D :
# 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: Select all

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
  }
}
Post Reply