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.

Banlist error :/!

Old posts that have not been replied to for several years.
Locked
W
Winters
Voice
Posts: 29
Joined: Sat Jul 09, 2005 12:24 pm

Banlist error :/!

Post by Winters »

I just made a banlist script with a Ban id but the bot just give errors

Here is the code:

Code: Select all

bind pub m {$banlist} banlist:channel

proc banlist:channel { nickname hostname handle channel arguments } {
putserv "notice $nickname :banlist for $channel:"
set number($channel) 0
foreach bans [banlist $channel] {
set banmask [lindex $ban 0]
set reason  [lindex $ban 1]
set creator [lindex $ban 5]
incr number($channel)
putserv "notice $nickname :ID: $number($chan) Banmask:$banmask Reason: $reason Creator: $creator"
}
}
And here the error:
wrong # args: should be "banlist nickname hostname handle channel arguments"
hile executing
"banlist $channel"
(procedure "banlist:channel" line 6)
invoked from within
"banlist:channel $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Your using the wrong 'ID'
You set the variable to number($channel) but you tell the nickname number($chan)

Also, why are you making an array out of it? There is little point as the variables are unset after the proc anyway.

Code: Select all

bind pub m {$banlist} banlist:channel

proc banlist:channel { nickname hostname handle channel arguments } {
putserv "notice $nickname :banlist for $channel:"
set number 0
foreach bans [banlist $channel] {
set banmask [lindex $ban 0]
set reason  [lindex $ban 1]
set creator [lindex $ban 5]
incr number
putserv "notice $nickname :ID: $number Banmask:$banmask Reason: $reason Creator: $creator"
}
} 
Locked