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.

Hmmmm, LoL tools bug

Old posts that have not been replied to for several years.
Locked
V
ViaraiX

Post by ViaraiX »

Who here find that the scripting for the ban mask with the latest version of lols tool doesn't work all the time.

6:06:56 PM <redhat> [18:10] TCL error [pub_lol_ban]: can't read "mask": no such variable
D
Da_Monkey

Post by Da_Monkey »

In the script, and more exactly in the proc called to make such a ban, you're sure that the variable "mask" is called in parameters ? Or maybe as a global var ?

++
Fred
V
ViaraiX

Post by ViaraiX »

here is the code which is used and i did a !ban on someone and that error happened

### !BAN <nick|mask> [time] [reason]

proc pub_lol_ban {nick host hand chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $hand $nick $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : 02/msg $botnick id <password>02 or 02/msg $botnick silent <password>02 to no more receive this warning."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $nick :02Usage:02 [string trim $lol(cmdchar)]ban <nick|mask> [time] [reason]"
return 0
}
set who [lindex $arg 0]
set ti [lindex $arg 1]
if {[number $ti]} {
set reason [lrange $arg 2 end]
} {
set ti ""
set reason [lrange $arg 1 end]
}
if {$reason == ""} {set reason "requested"}
if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
if {$reason == "requested"} {set reason "MaskBan: $who"}
set who [strlwr $who]
set bancount 0
set flags "-$lol(no_ban_flags)&-$lol(no_ban_flags)"
if {$lol(no_ban_flags) == ""} {
set list [strlwr [chanlist $chan]]
} {
set list [strlwr [chanlist $chan $flags]]
}
foreach chanuser $list {
set banmask ""
if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
incr bancount
set ipmask [lindex [split [maskhost $chanuser![getchanhost $chanuser $chan]] "@"] 1]
set userm [lindex [split [getchanhost $chanuser $chan] "@"] 0]
set banmask *!*$userm@$ipmask
newchanban $chan $banmask $nick $reason
if {[botisop $chan]} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $chanuser :$nick: $reason"
}
}
}
if {$bancount == 0} {
puthelp "NOTICE $nick :Sorry but no one matches this mask."
}
} {
if {![onchan $who $chan]} {
puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
return 0
}
if {[strlwr $who] == [strlwr $botnick]} {
puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
return 0
}
if {[nick2hand $who $chan] != "*"} {
if {$hand != [nick2hand $who $chan]} {
if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
return 0
}
if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
return 0
}
}
}
set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
set userm [lindex [split [getchanhost $who $chan] "@"] 0]
set banmask *!*$userm@$ipmask
if {[botisop $chan]} {
if {[isop $who $chan]} {pushmode $chan -o $who}
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $who :$reason"
}
switch $ti {
""
{
newchanban $chan $banmask $nick $reason
puthelp "NOTICE $nick :New mask added: $mask"
}
0
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added permanently: $mask"
}
default
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added for $ti minutes: $mask"
}
}
}
return 0
}
I
Ian-Highlander
Op
Posts: 165
Joined: Mon Sep 24, 2001 8:00 pm
Location: Ely, Cambridgeshire

Post by Ian-Highlander »

from what I can tell (and I only looked at it quickly) changing all instances of $mask to $banmask should fix this problem.

But I have got a bad headache so dont blame me if this is wrong lol

Regards

Ian-Highlander
"Insanity Takes Its Toll, Please Have Exact Change"
V
ViaraiX

Post by ViaraiX »

Yeah it worked. Thanks alot mate, I should email this to the author since it should be really be fixed for any further versions of the script.
Locked