Hi guys, can someone show me if it is possible to catch/match IPs that were previously saved on a .txt file and trigger a ban on that IP for a certain amount of time?
bind join * * ip:check
proc ip:check {nick uhost hand chan} {
if {[isbotnick $nick] || [validuser $hand]} return
set ip [lindex [split $uhost "@"] 1]
set fh [open "ips.txt"]
while {[gets $fh line] >= 0} {
if {[string equal -nocase $line $ip]} {
incr match
break
}
}
close $fh
if {[info exists match]} {
pushmode $chan +b $ip
}
}
this would work for all channels the bot is on, but if you wish to make it work just on a single channel and you won't change your mind any time soon then change:
thanks a lot caesar! im lookin forward to try it out.. and you are right willyw it would but I need to check exactly how this whole .txt string matching thing works.. still learning here