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.

IP Banning

Old posts that have not been replied to for several years.
Locked
s
sirgrim

Post by sirgrim »

I am writing a script for my bot to work with CGI:IRC, it runs a ipaccess file to deny ips, etc, and I got the bot to add to that file right, but the users also have a userinfo ctcp command, that outputs there real ip, so I need my bot to execute a ctcp userinfo on the person specified, get the output, parse out the IP address, and add it to the file, would also like to output the whole userinfo ctcp to the channel, and a message about it being banned. Appreciate any help.
s
sirgrim

Post by sirgrim »

I figured out how to do this. Here's how if anyone ever need anything similar.

bind pub m !ipban pub_ipban
bind ctcr - USERINFO pub_uinfo

proc pub_ipban {nick host handle channel args} {
set who [lindex $args 0]
putserv "PRIVMSG #Lamest :$nick has requested a ban on $who"
putserv "PRIVMSG $who :01USERINFO01"
}

### #Lamest is grimbot's chan, also default eggdrop chan ;D. ###

proc pub_uinfo {nick host handle channel args} {
set ipp [lindex $args 1]
set ipp2 [lindex $ipp 0]
putserv "PRIVMSG #Lamest :$args"
putserv "[exec echo !$ipp2 >> /www/cgi-bin/ipaccess]"
putserv "PRIVMSG #Lamest :I have banned $ipp2 from WAGD.com's CGI:IRC."
return 1
}

I'm sure there's probably a easier way to do it, but this works perfectly. Shoutz to the forum.
Locked