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.

where is wrong in code?

Old posts that have not been replied to for several years.
Locked
x
xGame
Voice
Posts: 24
Joined: Wed Aug 06, 2003 4:55 pm

where is wrong in code?

Post by xGame »

i want bot check every 5 mins if ops in channel less 2 ops then lock mode channel +m , now this script lock channel every 5 mins and not care about ops count :(
where is wrong in code ?

Code: Select all

# Set how long that bot must check mode and lockmode back again.
set timeschks 5
set chan "#channel"
### Start Call Command
timer $timeschks opschk

proc opschk {} {
global timeschks chan
set ops 0
foreach nick [chanlist $chan] {
    if {[isop $nick $chan]} {incr ops}
    if {$ops < 2} {  putserv "MODE $chan +m" }
}
timer $timeschks opschk
}

putlog "Loaded Successfuly..opscheck"

User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

move the if {$ops < 2} { putserv "MODE $chan +m" } outside of the foreach loop.
Once the game is over, the king and the pawn go back in the same box.
Locked