mIRC Homepage
Posted By: Garou ctcp reply kick - 03/11/06 05:39 PM
ON *:JOIN:#chat: {
.ctcp $nick version

ON *:CTCPREPLY:version*: {

I want to ban on ctcp reply if I get a bad script reply is this possible?
Posted By: Riamus2 Re: ctcp reply kick - 03/11/06 08:18 PM
Include this in your ctcpreply event:

Code:
if (word isin $1- || word2 isin $1- && $nick ison #chat) {
  ban -ku600 #chat $nick 2
}


Replace word/word2 with whatever you want to check for. You can use phrases as well. Note that this is for a single channel. Because a version reply isn't channel specific, you'll need to specify what channel(s) you want it to work for.
Posted By: Garou Re: ctcp reply kick - 04/11/06 04:36 AM
THx Riamus2, wat does this do when coded this way?

ON *:JOIN:#chat: {
;; a fullstop (period ".")
.ctcp $nick version
set -u15 %joinedchan
}
ON *:CTCPREPLY:version*: {
if (echoX isin $1- || virus isin $1- || inviter isin $1- || ozinviter isin $1- && $nick ison #chat) {
ban -ku600 #chat $nick 2 14Inviter Script Detected
}
Posted By: Garou Re: ctcp reply kick - 04/11/06 06:59 AM
Its not kicking frown
Posted By: Riamus2 Re: ctcp reply kick - 04/11/06 03:18 PM
A period, or dot, is used to silence a command so that you do not see any output from it.

As for not kicking, are you sure that the person is replying with a version message that matches your IF? Insert an "echo -a test - $1-" (no quotes) before the IF and an "echo -a test2" inside the IF. Have someone give a the correct version reply and see if either echoes are displayed. The first one should display the ctcpreply information, so you can compare it with your IF statement. Paste that in here and we'll see what is going on.

Also, I'm not sure what your variable in the on JOIN is there for.
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 03:21 PM
You are missing a }

Never tried this but i would maybe do similiar to this

Code:
on *:CTCPREPLY:VERSION*: {
  if ($nick ison #chat) {
    if (echoX isin $1- || virus isin $1- || inviter isin $1- || ozinviter isin $1-) {
      ban -ku600 #chat $nick 2 14Inviter Script Detected
    }
  }
}
 
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 04:17 PM
I messed with it a little more and came up with a better solution.
Instead of parsing a number of OR statements i made it so that it will look for any word ina variable called %ctcp and ban if the reply matches any word in the var seperated by a space. more flexible

also i used $comchan instead of hardcoding the channel in.

Code:
 on *:CTCPREPLY:VERSION*: {
  var %i = 0
  while (%i < $numtok(%ctcp,32)) {
    inc %i
    var %ctcpreply = $gettok(%ctcp,%i,32)
    if ($istok($strip($1-),%ctcpreply,32) == $true) {
      VAR %c = 0
      while (%c < $comchan($nick,0)) { 
        inc %c
        if ($me isop $comchan($nick,%c))  {
          ban -ku600 $comchan($nick,%c) $nick 2 14Inviter Script Detected
        }
      }
    }
  }
}  


USAGE //set -s %ctcp echoX virusc inviter ozinviter

add more by going to your vars tab and adding more words
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 04:27 PM
you have to add your ON join event to that as this is only for the reply. Your code earlier looked fine. although dont get the var you are setting.
Posted By: Garou Re: ctcp reply kick - 04/11/06 07:58 PM
Is this right?

ON *:JOIN:#chat: {
;; a fullstop (period ".")
.ctcp $nick version
set -u15 %joinedchan
}
on *:CTCPREPLY:VERSION*: {
var %i = 0
while (%i < $numtok(%ctcp,32)) {
inc %i
var %ctcpreply = $gettok(%ctcp echoX virusc inviter ozinviter,%i,32)
if ($istok($strip($1-),%ctcpreply,32) == $true) {
VAR %c = 0
while (%c < $comchan($nick,0)) {
inc %c
if ($me isop $comchan($nick,%c)) {
ban -ku600 $comchan($nick,%c) $nick 2 14Inviter Script Detected
}
}
}
}
}
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 09:21 PM
Code:
 ON !@*:JOIN:#test: {
  if !$($+(%,version.check,.,$fulladdress),2) {
    .ctcp $nick VERSION
    set -e $+(%,version.check,.,$fulladdress) 1
  }
}
on *:CTCPREPLY:VERSION*: {
  var %i = 0
  while (%i &lt; $numtok(%ctcp,32)) {
    inc %i
    var %ctcpreply = $gettok(%ctcp,%i,32)
    if ($istok($strip($1-),%ctcpreply,32) == $true) {
      VAR %c = 0
      while (%c &lt; $comchan($nick,0)) { 
        inc %c
        if ($me isop $comchan($nick,%c))  {
          ban -ku600 $comchan($nick,%c) $nick 2 14Inviter Script Detected
        }
      }
    }
  }
}  
 


I also set a variable that it wont CTCP the user more then once which is good if you are on a few common channels as the user.
I used $fulladdress so you can still CTCP clones, the vars will unset when you close mIRC
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 09:30 PM
i jusr realized the -e switch may only be for 6.2 as it dosent seem to work in 6.16 so make sure you use the latest version of mIRC. if you like 6.16 i can make an addition to the script that will unset them when mIRC closes.
Posted By: Garou Re: ctcp reply kick - 04/11/06 09:38 PM
Am using 6.17 is it ok?

and where or on wat line do I add more bad script name to check from the ctcpreply?

Like these here echoX virus inviter ozinviter
Posted By: HaleyJ Re: ctcp reply kick - 04/11/06 10:14 PM
if the -e swich is not working maybe add this

Code:
 ON *:DISCONNECT:/unset %version.* 


and remove the -e from the set

to add CTCP words. alt + r go to the variables tab and add them to %ctcp make sure they are seperated by a space

e.g %ctcp invite trojan virus xchat

or //set -s %ctcp $addtok(%ctcp,word,32)

replace word for the word you wanna add

smile
Posted By: Garou Re: ctcp reply kick - 04/11/06 10:30 PM
Thx you very much guys its working great now :P
© mIRC Discussion Forums