mIRC Homepage
Hello everyone,

I would like to know is there any possible way to block a certain isp from entering my channel?
I want to block everyone with a aol.com hostmask. The reason for this being their hostmask always changes and bypasses my banlist.

I have no clue on how to do this or if there are any commands to do so. The only thing I can think of was setting up a type of a AutoVoice script that will KB them.

Php Code:

on *:JOIN:#: {
  if (%AntiAOL. [ $+ [ $chan ] ] == on) {
  .ban -k $chan $nick }
  elseif (%AntiAOL. [ $+ [ $chan ] ] == off) { HALT }
  else { halt }
}
} 


Something along those lines using a remote script to activate. But that is totally wrong.

If anyone has any clue on how to rid a certain ISP please tell smile

Thanks.
As long as they aren't showing an IP instead of HOST, you can use:

Code:
on @*:join:#yourchannel: {
  if (aol.com isin $wildsite) { ban -ku300 $chan $nick AOL Sucks! }
}

Here's an additional robust code and very simple..

Code:
on 1*:join:#Channelname: {
  if (*!*@hostmask iswm $address($nick,2)) {
    mode #Channelname +b $address($nick,2)
    kick #Channelname $nick ( whatever your reason is )
  }
}

Hope that helps =)
The usage of the 1 prefix in the on join event is irrelevant when combined with the * wildcard. Also most networks require you to have ops in the channel before allowing you to set a mode and/or kick (likewise with ban), and your code doesn't check for that.

The usage of the @ character in the prefix section of the on join event (as shown in Riamus' code) ensures that the client (person/bot) running the code has ops in the channel before issuing the ban command.
If you were to look at the actual sequence of events that are completed when the ban command is issued with the -k switch, you would see that the ban mode is set first, then the person is kicked.

For the above reasons, I find that Riamus' code to be superior.
© mIRC Discussion Forums