mIRC Homepage

Help to find error

Posted By: Garou

Help to find error - 05/11/06 01:35 PM

This script should kick ban the user matching mask already in the channel when I get a #channel spam from outside the channel. Any ideal why it dont work?

on *:text:*:?: {
if (%Relay == off) || !%Relay || ($nick isop #) { return }
var %s.chan = #manila
if ($nick !ison %s.chan && $me isop %s.chan) {
var %nick.addr = $address($nick,2)
var %cnt = $nick(%s.chan,0)
while (%cnt) {
if ($address($nick(%s.chan,%cnt),2) == %nick.addr) {
ban -k %s.chan $nick(%s.chan,%cnt) 2 14Relay Spammer Detected
}
dec %cnt
}
}
}
Posted By: HaleyJ

Re: Help to find error - 05/11/06 01:38 PM

do you mean if someone pm floods you, you want to ban him from a channel?
Posted By: Garou

Re: Help to find error - 05/11/06 01:41 PM

I mean if they pm me #anychannel then ban the any matching ip in the channel I just join or where am already op on.
Posted By: HaleyJ

Re: Help to find error - 05/11/06 01:45 PM

how would you know if its a spammer PMING you not some innocent user asking for help?
Posted By: Garou

Re: Help to find error - 05/11/06 01:51 PM

I know because we get a spam #channel usely on login and those advertiser are usely not in any channel but they always have a clone sitting in the channel they send spam to.
They only way to cath them now is to manully find their matching ip and ban them.
Posted By: HaleyJ

Re: Help to find error - 05/11/06 02:13 PM

if (%Relay == off) || !%Relay || make sure you have a var called relay and make it = on as otherwise it just returns, if it still dosent work lemme know and i will attempt to script it.

Just to clarify. if you are on #spamchannel and get a PM from a bot or whatever you want to ban all the clones on the channels you are op on? if not then please clarify also why join the channel?
Posted By: Garou

Re: Help to find error - 05/11/06 02:21 PM

Yes I want to ban all clones and I do have a var name %relay on
Posted By: HaleyJ

Re: Help to find error - 05/11/06 03:29 PM

i cant help you with the above script as a few things didnt make sense like the ! ison also i dont know what a relay spammer is and why you would join that channel. Anyways here is how i would do it as per your instructions if a user pms you whilst being on a spamchannel it will cycle through your channels and ban clones of the banned address so if there is more then one clone on the channel it would kick that aswell, made this during extra lessons :P so didnt have too much time to test it out. i used ISWM which is a wild match so may sometimes kick innocent users but i find its effective

Code:
 ON *:TEXT:*:?: {
  if ($nick ison #spamchannel) {
    var %c = 1, %i = $chan(0)
    while (%c <= %i) {
      if ($me isop $chan(%c)) {
        relayban $chan(%c) $address($nick,3)
        inc %c
      }
    }
  }
}
alias relayban { 
  var %lol = 1
  mode $1 +b $2
  while ($nick($$1,%lol) != $null) {
    IF ($2 iswm $ial($nick($$1,%lol))) { 
      kick $1 $nick($$1,%lol) 14Relay Spammer Detected
    }
    inc %lol
  }
} 
Posted By: HaleyJ

Re: Help to find error - 05/11/06 03:32 PM

note you hvae to be on the spamchannel or whatever for it to work otherwise the first IF statement cant parse change #spamchannel to whatever channel these spammers live in smile
Posted By: Garou

Re: Help to find error - 05/11/06 03:38 PM

Ok cool thx.
Do I replace this with my channe that am op in ??
if ($nick ison #spamchannel) {
to
if ($nick ison #chat) {
Posted By: HaleyJ

Re: Help to find error - 05/11/06 03:49 PM

no the script auto cycles through all the channels you are op on change it to the channel the spambot is on otherwise it will ban any user that PM's you

ON *:TEXT:*:?: {
if ($nick ison thespamchannel ) {
Posted By: Garou

Re: Help to find error - 05/11/06 03:57 PM

I see ok...the spambot is hidding on my channel so I have to add my channel that am op on.
Posted By: HaleyJ

Re: Help to find error - 05/11/06 04:02 PM

no you dont the script only exacutes if you are opped, you said the way you know its a spammer is because it resides on a certain channel which for arguments sake is called #spamchannel so you need to change that to the channel the bots reside NOTHING else, when the bot pm's you it will cycle through all channels you are OPPED on automatically and ban the clones
Posted By: Garou

Re: Help to find error - 05/11/06 04:14 PM

I see ok the bots reside on my channel.
Can fix it that it will only ban if there a # in front ?
Because now it kicking any text send to me in pv.
Posted By: HaleyJ

Re: Help to find error - 05/11/06 04:23 PM

then it will ban any user who pms you who is on your channel! which is a bit stupid.
if you can be a bit more clear on whats happening and what you mean by spamming your channel from outside your channel then when i get back from school ill try and put something together for you
Posted By: KingTomato

Re: Help to find error - 05/11/06 05:41 PM

HaleyJ
I think what they are describing is a bot who sits in the channel and tracks join/parts. From there, the bot messages another bot (not residing in the channel) that will in turn message you. The point of this obscurity is to "conceal" the spamming bot, and still track those who are on the channel.

What they are trying to accomplish is when they are PMed something, check the user's mask against a list of masks in the room. If they match, kick the "relay bot" (the one messaging the spammer you've entered). I hope I've made sense.

Garou

This should be what you're after. I used the $ialchan of mIRC as I feel it's faster for mIRC to do the searching. Additionally, I made it so you can add new channels to the list. Just add them in the red section seperated by a space, and the script will "potect" those channels as well (as long a you have op).

Code:
on *:TEXT:*:?: {
  var %chanlist = [color:red]#manila[/color]
  var %c = 1, %addr = $address($nick,2)
  while ($gettok(%chanlist,%c,32)) {
    var %chan = $v1, %matches = $ialchan(%addr,%chan,0)
    while (%matches && $me isop %chan) {
      /ban -k %chan $ialchan(%addr,%chan,%matches).nick 2 14Relay Spammer Detected
      /dec %matches
    }
    /inc %c
  }
}


As far as the IAL (which I thought of later as to why your script may/may not work), your listing may not be populated (you join the channel after several users are already on and as long as they don't talk, you won't get their Ial (and bots rarely do chat ;p)). So if you want to solve this as well (but be careful, some networks can be strict on the number of lines it generates) you can add these lines to your remotes:

Code:
on me:*:JOIN:#: {
  /who $chan
}


That will populate your ial with everyone's address. If you find you've added these lines and begin getting kicked off the network for flood, you may want to remove them.
Posted By: Garou

Re: Help to find error - 05/11/06 08:21 PM

KingTomato Thats exacly what I meat and neened thank you both I will give it a try.
Posted By: deegee

Re: Help to find error - 06/11/06 06:28 AM

You might need to change this
Code:
  var %c = 1, %addr = [color:red]$address($nick,2)[/color]

To this
Code:
  var %c = 1, %addr = [color:blue]$wildsite[/color]


The $address() identifier relies on the IAL, if the msg comes from a user not on any common channels it will return $null
© 2022 mIRC Discussion Forums