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 with shitlist

Support & discussion of released scripts, and announcements of new releases.
Post Reply
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Please help with shitlist

Post by Reynaldo »

Code: Select all

proc pub_+akick {nick uhost hand channel param} {
global botname botnick
set rest [lindex $param 0]
if {$rest == ""} {
puthelp "NOTICE $nick :Usage: +akick <nick/hostname>"
return 0
}
if {$rest == "*" || $rest == "*!*@*"} {
puthelp "NOTICE $nick :invalid hostname..!"
return 0
}
if {$rest == $botnick} {
puthelp "NOTICE $nick :DeNiEd..!"
return 0
}
if {[validuser $rest]} {
puthelp "NOTICE $nick :$rest is already on database with flags: [chattr $rest]"
return 0
}  
if {![string match "*@*" $rest]} {
set rest "$rest!*@*"
}
if {[string match $rest $botname]} {
puthelp "NOTICE $nick :DeNiEd..!"
return 0
}
if {[finduser $rest] != "*"} {
if {[finduser $rest] != "AKICK"} {
puthelp "NOTICE $nick :That Host Belongs To [finduser $rest]"
}
puthelp "NOTICE $nick :That Host already in [finduser $rest]"
return 0
}
puthelp "NOTICE $nick :ADD \[$rest\] To KIcKLIsT..!"
utimer 1 [list setuser "AKICK" HOSTS $rest]
saveuser
foreach x [channels] {
if {[isop $botnick $x]} {
foreach c [chanlist $x K] {
if {![matchattr $c f]} {
akick_chk $c [getchanhost $c $x] $x
}
}
}
}
return 0
}
proc akick_chk {nick uhost chan} {
global bannick
foreach x [getuser "AKICK" HOSTS] {
if {[string match [string tolower $x] [string tolower "$nick!$uhost"]]} {
set bannick($nick) $x
putquick "KICK $chan $nick : Blacklist MaTcH FRoM  $x]"
return 0
}
}
}
That's scripts for adding the shitlist, it working fine with a list without a special character like [,],{,},\ . it will return nothing when i added the shitlist with the special character like [user, [user], \user\. any idea hot to get it working with any shitlist like service of chanserv, [*]!@* or [test!*@*.
Here's the list in the cfgfile

Code: Select all

AKICK      - K
--HOSTS telnet!*@*
--HOSTS *!*@91.102.*
--HOSTS *!*HeliX@110.*
--HOSTS [Windows!*@*
so the scripts will not kick that nick [Windows, when it join to channel. i've already add the akick_chk in to lines of "bind join" aswell.
Please help with that code. Thankyou
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

This behaviour is partly due to the fact that you use the lindex command on a string, rather than a proper list. Whenever you need to use lindex, and the data i not a valid list, atleast take the time to use split to convert it into a list.

Also, RFC1459 case mapping is rather different for extended characters than tcl's. This could also be a source for your issues.

Finaly, why don't you just use the internal banlist within eggdrop? Seems to me tbat you are simply trying to re-invent the wheel..
NML_375
Post Reply