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.

please help me fix this

Old posts that have not been replied to for several years.
Locked
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

please help me fix this

Post by ShavdApe »

I have tried fo the last 2 days to get this to work and now for some strange reason i recieve this error.

Tcl error [pub:waron]: invalid command name "warauto"

The are probably numerous bugs but being a noob i dont know what to look for.

bind pub o "!waron" pub:waron
bind pub o "!waroff" pub:waroff
proc pub:waron {nick host hand chan arg} {
warauto $arg
set warin [open warserver r]
while {![eof $warin]} {
gets $warin warline
if {[lindex $warline 0]==$arg} {
putquick "PRIVMSG $chan :Auto War announce is already running!"
return 0
}
}
close $warin
set warout [open warserver a]
puts $warout "$arg"
close $warout
putquick "PRIVMSG $chan :Auto War announce started on $arg"
return 1
}


proc getcidmap {} {
set warin [open warserver r]
while {![eof $warin]} {
gets $warin warline
set warline [split $warline]
set serv [lindex $warline 0]
close $warin
return $serv
}
close $warin
}
return ""
}

proc warauto {} {
global pathqstat
set $chan "#apey"

set serv [getcidmap]

set stat [open "|$pathqstat/qstat -timeout 30 -q3s $serv -Ts $pathqstat/server.qstat -Tp $pathqstat/players.qstat -P " r]

# output the result.
qstat:results $chan $nick $stat

# close fork, end program.
close $stat
set rtime [timer 1 warauto]
return 0
}

proc pub:waroff {nick host hand chan arg} {
global rtime
set warout [open warserver w]
puts $warout "" nonewline
close $warout
putquick "PRIVMSG $chan :Removed all server entries from autoannounce"
catch { killtimer $rtime }

return 1
}
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

ShavdApe wrote: ...
warauto $arg
...
proc warauto {} {
...
first, you send arguments to warauto, but it doesn't take any arguments in its definition.
So, just call warauto, without any argument.
If the problem persists, verify that your proc is well defined.
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

Post by ShavdApe »

ok i removed the $arg and it still doesnt work.

I am not exactly sure what you mean by the well defined statement (did I mention im a noob to tcl ;) )
Locked