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.

Help with ban script

Old posts that have not been replied to for several years.
B
BassTeQ

Post by BassTeQ »

Here is my delima, my irc server uses cloaking to mask the host of users when they login to IRC, so their IP cant be located.
it looks something like
BassTeQ!BassTeQ@vw-7745.inet.com

Now the problem is that there is that if a user comes onto the server with their identd turned ON then their host looks like that example above. If its turned off then it looks like
BassTeQ!BassTeQ@vw7745.inet.com
(Notice no - character between the vw and 7745) So my users have worked out they can get around a ban by turning there identd ON or OFF.

What I would like to do is to have a script that whenever a ban is set, and the hostname starts with 'vw' then ban both possible host masks, eg
*!*@vw-7745.inet.com
and
*!*@vw7745.inet.com

Any help would be greatly appreciated.

Thanks
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Note: this will fill the ban list rather quick.
bind mode - "% +b" vw:addban
proc vw:addban {nick uh hand chan mc arg} {
if {[string index [set t [lindex [split $arg @] 1]] 0 2] == "vw"} {
if {[string index $t 2] == "-"} {
set b "*!*@vw[string range $t 2 end]"
} else {
set b "*!*@vw-[string range $t 3 end]"
}
putserv "MODE $chan +b $b"
}
}
B
BassTeQ

Post by BassTeQ »

Wow, quick reply!!!
Thanks ppslim :smile:
So when the bot removes the ban will this remove the 2nd ban placed by the script too?

Thanks
B
BassTeQ

Post by BassTeQ »

It looks like it just does +b
so if I used the code below as well would this acheive as my question states above?

Code: Select all

bind mode - "% -b" vw:remban 
proc vw:remban {nick uh hand chan mc arg} { 
if {[string index [set t [lindex [split $arg @] 1]] 0 2] == "vw"} { 
if {[string index $t 2] == "-"} { 
set b "*!*@vw[string range $t 2 end]" 
} else { 
set b "*!*@vw-[string range $t 3 end]" 
} 
putserv "MODE $chan -b $b" 
} 
} 


<font size=-1>[ This Message was edited by: BassTeQ on 2001-12-13 20:27 ]</font>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Not fully checked over, but yes it should.
B
BassTeQ

Post by BassTeQ »

Cheers Ill test it out tonight, thanks mate!
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

You might want to make that first one "string range" instead of "string index"
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It was string range before submitting, but I changed while testing somthing. Guess I forgot to change it back when I pasted it back in.

In the first if, you should change the "string index" to "string range" as sugested. In both parts of the script.
B
BassTeQ

Post by BassTeQ »

thanks guys
I made the changes suggested, so my code now looks like.
bind mode - "% +b" vw:addban
proc vw:addban {nick uh hand chan mc arg} {
if {[string range [set t [lindex [split $arg @] 1]] 0 2] == "vw"} {
if {[string range $t 2] == "-"} {
set b "*!*@vw[string range $t 2 end]"
} else {
set b "*!*@vw-[string range $t 3 end]"
}
putserv "MODE $chan +b $b"
}
}
Ive loaded the script, restarted my bot, but it doesnt seem to work.
If I do a ban in the bot, the ban goes through but the script doesnt do as it should.

Here is the output from the channel

[18:38] *** bot sets mode: +b *!*@vw-11245.optusnet.com.au
[18:38] *** iceb was kicked by bot (banned: test)

Any ideas?
Thanks
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

if {[string range $t 2] == "-"} {



should be



if {[string index $t 2] == "-"} {
B
BassTeQ

Post by BassTeQ »

Thanks for the reply, but that didnt seem to work either.
my code now looks like
proc vw:addban {nick uh hand chan mc arg} {
if {[string range [set t [lindex [split $arg @] 1]] 0 2] == "vw"} {
putserv "NOTICE $chan Ive detected a ban"
if {[string index $t 2] == "-"} {
set b "*!*@vw[string range $t 2 end]"
} else {
set b "*!*@vw-[string range $t 3 end]"
}
putserv "MODE $chan +b $b"
}
}
I dont even get the notice to the channel "Ive detected a ban" so its not going into that part of the if statement.

Any ideas?

Thank You.

.

<font size=-1>[ This Message was edited by: BassTeQ on 2001-12-17 04:47 ]</font>
B
BassTeQ

Post by BassTeQ »

Anyone?
Please!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Is the actual ban mask vw-786238.3323.2323.blah.

The vw is currently case sensitive, so is the case mixed.
B
BassTeQ

Post by BassTeQ »

the vw is always lower case
for example:
if the host is
BassTeQ!BassTeQ@vw-7745.inet.com
then the ban mask would be
*!*@vw-7745.inet.com

P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

just shove a few string tolower's in there then you don't have to worry about it :razz:
Locked