mIRC Home    About    Download    Register    News    Help

Print Thread
#181560 26/07/07 04:35 PM
Joined: Sep 2006
Posts: 21
S
sabbath Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2006
Posts: 21
OK, my other problem was solved in a nifty way so I'll just ask about this one as well. We're starting to getting problems with playstation/xbox-spamming (which I guess pays off in a console-oriented channel). We have three channels, one for each console, and I'd like to kick people who says the same thing in all three pretty much at the same time. This is what I'm doing now.

Code:
on *:TEXT:*playstation*:#PS2_3:{
  write ch_ps.txt $ctime $nick $1-
}


on *TEXT:*playstation*:#XBOX_XBOX360:{
  var %words = $1-
  var %ps = 1, %psmax = $lines($mircdirSpamlist\ch_ps.txt)
  while (%ps <= %psmax) {
    if ($gettok($read($mircdirSpamlist\ch_ps.txt,%ps),3-,32)) == %words) {
      if ($calc($ctime - $gettok($read($mircdirSpamlist\ch_ps.txt,%ps),1,32))) <= 60 {
        if ($nick == $gettok($read($mircdirSpamlist\ch_ps.txt,%ps),2,32)) {
          ban $nick 
          kick $nick You have been kicked for spamming in multiple channels!
        }
      }
    }
    inc %ps
  }
}


Is it possible to instead compare the two channels directly?

I looked at /filter, but that doesn't seem to do what I'm after. And my code is probably far from the best way of doing this, even though it works most of the time. smile

Cheers!

Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
how about setting a timer to check?

something like
Code:
on 1:text:*playstation*:#chan1,#chan2,#chan3,etc:{
  if !$timer($+($nick,playstation)) {
    $+(timer,$nick,playstation) 1 10 noop
    }
  else kick $chan $nick Multiple Channel Spam Kick!
  }
}


that'll wait for someone to say playstation in any of the three channels and if they do set a 10 second timer(that does nothing(noop)) then if they say playstation again within 10 seconds in any channel it sees the timer is set already and they are kicked from the channel they say it in(the second time) obviously you can change settings as you require...untested


billythekid

Link Copied to Clipboard