mIRC Home    About    Download    Register    News    Help

Print Thread
#163695 03/11/06 05:39 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
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?

Last edited by Garou; 03/11/06 05:46 PM.
#163696 03/11/06 08:18 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
#163697 04/11/06 04:36 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
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
}

#163698 04/11/06 06:59 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Its not kicking frown

#163699 04/11/06 03:18 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
#163700 04/11/06 03:21 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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
    }
  }
}
 


Newbie
#163701 04/11/06 04:17 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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


Newbie
#163702 04/11/06 04:27 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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.


Newbie
#163703 04/11/06 07:58 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
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
}
}
}
}
}

#163704 04/11/06 09:21 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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


Newbie
#163705 04/11/06 09:30 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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.


Newbie
#163706 04/11/06 09:38 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
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

Last edited by Garou; 04/11/06 10:04 PM.
#163707 04/11/06 10:14 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
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


Newbie
#163708 04/11/06 10:30 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Thx you very much guys its working great now :P


Link Copied to Clipboard