|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Am using this to check version on join...Is it possible to store bad script names in text file instaed of var? %CTCP MurderScript stealth.Inviter echoX inviter ozinviter echoxinviter VirusScript
ON !@*:JOIN:#: {
if (%CTCPREPLY == off) || !%CTCPREPLY || ($nick isop $chan) { return }
if !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress) 1
}
}
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 -ku3600 $comchan($nick,%c) $nick 2 14Inviter Script Detected
}
}
}
}
}
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Sure, you'll just have to do your comparison to read from the text file, rather than checking the token, which, for something like this would actually be better, since you'd also be able to allow for version names that include spaces.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Can this also be codes so that I dont see or get the version reply in a pm window and just kick ban when it finds a bad script??
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Create a file in the mIRC installation directory called CTCP.txt Have each line in the file contain one version reply that you want the ban for. Ops can turn the CTCP check on/off via a message to the bot using !ctcp on (or !ctcp off) in either the channel or pm. If the command is sent via pm, then the ctcp checking is turned on/off for all channels in which the person has ops. on $*:text:!ctcp[onoff]:*:{
if $nick isop $chan {
set $+(%,ctcp,.,$chan) $iif($2 == on,$true,$false)
}
elseif !$chan {
var %a = 1, %b = $comchan($nick,0)
while %a <= %b {
if $nick isop $comchan($nick,%a) {
set $+(%,ctcp,.,$comchan($nick,%a)) $iif($2 == on,$true,$false)
}
inc %a
}
}
}
on @*:join:#:{
if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress) $chan
}
}
on ^*:ctcpreply:version*:{
if $read(ctcp.txt,nwt,$2-) {
.ban -ku3600 $($+(%,version.check,.,$fulladdress),2) $nick
}
}
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
How can I check if its working? Will i see %ctcp On in var? Because its not kicking or its not working.
Last edited by Garou; 26/05/07 08:46 PM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on $*:text:!ctcp[onoff]:*:{
if $nick isop $chan {
set $+(%,ctcp,.,$chan) $iif($2 == on,$true,$false)
.notice $nick CTCP Version check for $chan is now $iif($($+(%,ctcp,.,$chan),2),On,Off)
}
elseif !$chan {
var %a = 1, %b = $comchan($nick,0)
while %a <= %b {
if $nick isop $comchan($nick,%a) {
set $+(%,ctcp,.,$comchan($nick,%a)) $iif($2 == on,$true,$false)
.notice $nick CTCP Version check for $comchan($nick,%a) is now $iif($($+(%,ctcp,.,$comchan($nick,%a)),2),On,Off)
}
inc %a
}
}
}
on @*:join:#:{
if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress) $chan
}
}
on ^*:ctcpreply:version*:{
if $read(ctcp.txt,nwt,$2-) {
.ban -ku3600 $($+(%,version.check,.,$fulladdress),2) $nick
}
} Added a message to show to the person that turns the checking on/off the status of the CTCP checking for the relative channel. Please note the the version check must match whst's in the text file exactly (case insensitive). Eg: RusselB's Alias Tracker won't match RusselB's Alias Tracker v2.0
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
At a glance I'd suggest changing this line - on $*:text:!ctcp[onoff]:*:{
to this on $*:text:/^!ctcp (on|off)/Si:*:{ Edit: Plus the version reply... on ^*:ctcpreply:version*:{
if $($+(%,version.check,.,$fulladdress),2) {
if $read(ctcp.txt,nwt,$2-) { ban -ku3600 $($+(%,version.check,.,$fulladdress),2) $nick 2 Bad script! }
unset $+(%,version.check,.,$fulladdress),
halt
}
}
Last edited by deegee; 29/05/07 05:00 PM.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Ok the on anf off is working but its not kicking.
Last edited by Garou; 30/05/07 01:10 PM.
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Remove the ^ from this line: on [color:red]^*:ctcpreply:version*:{[/color] It should be: on *:ctcpreply:version*:{
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Thx its working fine now. Is it possible not to version someone that just login a few minutes ago like antispam bots that cycle channels?
Last edited by Garou; 30/05/07 04:59 PM.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Can this be change to check any matching word on the line not just the exact word from the CTCP.txt ? My ctcp.txt reads like this: oz3 stealth.Inviter echoX inviter ozinviter
on $*:text:/^!ctcp (on|off)/Si:*:{
if $nick isop $chan {
set $+(%,ctcp,.,$chan) $iif($2 == on,$true,$false)
.notice $nick CTCP Version check for $chan is now $iif($($+(%,ctcp,.,$chan),2),On,Off)
}
elseif !$chan {
var %a = 1, %b = $comchan($nick,0)
while %a <= %b {
if $nick isop $comchan($nick,%a) {
set $+(%,ctcp,.,$comchan($nick,%a)) $iif($2 == on,$true,$false)
notice $nick CTCP Version check for $comchan($nick,%a) is now $iif($($+(%,ctcp,.,$comchan($nick,%a)),2),On,Off)
}
inc %a
}
}
}
on @*:join:#:{
if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress) $chan
}
}
on *:ctcpreply:version*:{
if $($+(%,version.check,.,$fulladdress),2) {
if $read(ctcp.txt,nwt,$2-) { ban -k $($+(%,version.check,.,$fulladdress),2) $nick 2 14Bad Script Detected }
unset $+(%,version.check,.,$fulladdress),
halt
}
}
Last edited by Garou; 05/06/07 06:45 PM.
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
If you mean if one of the lines in ctcp.txt is a wildmatch to the version reply, try this on *:ctcpreply:version*:{
if $($+(%,version.check,.,$fulladdress),2) {
if !$hget(vercheck) { hmake vercheck 10 | hload -n vercheck CTCP.txt }
if $hfind(vercheck,$strip($2-),1,R).data { ban -k $($+(%,version.check,.,$fulladdress),2) $nick 2 14Bad Script Detected }
unset $+(%,version.check,.,$fulladdress),
halt
}
} It will, for instance, match "echoX" to - echoXscript
- echoX
- echoX
etc
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Not working, exemple: i want to ban #Music-Central or any single word from this version reply: Central MP3 Script v6.137d beta (get it in #Music-Central on DALnet or from www.jalyn.com/mco/index.html)
Last edited by Garou; 07/06/07 03:18 PM.
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
What I didn't give you was a way to update the table from the textfile, sorry. Replace if !$hget(vercheck) { hmake vercheck 10 | hload -n vercheck CTCP.txt } with
if !$hget(vercheck) { hmake vercheck 10 }
if $lines(CTCP.txt) { hdel -w vercheck * | hload -n vercheck CTCP.txt }
Also be aware, that this method is case-sensitive. ("#music-central" won't match "#Music-Central")
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Not working, no ban on join.
on $*:text:/^!ctcp (on|off)/Si:*:{ if $nick isop $chan { set $+(%,ctcp,.,$chan) $iif($2 == on,$true,$false) } elseif !$chan { var %a = 1, %b = $comchan($nick,0) while %a <= %b { if $nick isop $comchan($nick,%a) { set $+(%,ctcp,.,$comchan($nick,%a)) $iif($2 == on,$true,$false) } inc %a } } } on @*:join:#:{ if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$address),2) { .ctcp $nick VERSION set -e $+(%,version.check,.,$address) $chan } } }
on *:ctcpreply:version*:{ if $($+(%,version.check,.,$fulladdress),2) { if !$hget(vercheck) { hmake vercheck 10 } if $lines(CTCP.txt) { hdel -w vercheck * | hload -n vercheck CTCP.txt } if $hfind(vercheck,$strip($2-),1,R).data { ban -k $($+(%,version.check,.,$fulladdress),2) $nick 2 14Bad Script Detected } unset $+(%,version.check,.,$fulladdress), halt } }
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Look at the variables being set, and checked. Somewhere along the line you changed some to $address instead of $fulladdress, but left others. In the join event it is !$($+(%,version.check,.,[color:red]$address),2)[/color] $+(%,version.check,.,[color:red]$address)[/color] while in the ctcpreply event it is $($+(%,version.check,.,[color:red]$fulladdress),2)[/color] $+(%,version.check,.,[color:red]$fulladdress)[/color] They should all be the same. PLUS: There is an extra closing brace in the join event, so the ctcp event won't even be triggered.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
This is wat I have now, where is the error?
on $*:text:/^!ctcp (on|off)/Si:*:{ if $nick isop $chan { set $+(%,ctcp,.,$chan) $iif($2 == on,$true,$false) } elseif !$chan { var %a = 1, %b = $comchan($nick,0) while %a <= %b { if $nick isop $comchan($nick,%a) { set $+(%,ctcp,.,$comchan($nick,%a)) $iif($2 == on,$true,$false) } inc %a } } } on @*:join:#:{ if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) { .ctcp $nick VERSION set -e $+(%,version.check,.,$fulladdress),2) $chan } } }
on *:ctcpreply:version*:{ if !$($+(%,version.check,.,$fulladdress),2) { if !$hget(vercheck) { hmake vercheck 10 } if $lines(CTCP.txt) { hdel -w vercheck * | hload -n vercheck CTCP.txt } if $hfind(vercheck,$strip($2-),1,R).data { ban -k $($+(%,version.check,.,$fulladdress),2) $nick 2 14Bad Script Detected } unset $+(%,version.check,.,$fulladdress), halt } }
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
PLUS: There is an extra closing brace in the join event, so the ctcp event won't even be triggered. ^ There is the error. Check that your opening/closing braces are matched. You can use the {} button in the script editor to check them. on @*:join:#:{
if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress),2) $chan
}
}
} <---- This one should not be here!
|
|
|
|
|