mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 11
K
kein Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Mar 2006
Posts: 11
ctcp !@*:*:#: { if ($nick isreg #) { .signal -n $gettok(c,1-,32) # $nick | haltdef } }
on !@*:ctcpreply:*: { if ($nick isreg #) { .signal -n $gettok(r,1-,32) # $nick | haltdef } }
on ^!@*:text:*:#: { if ($nick isreg #) { .signal -n $gettok(e,1-,32) # $nick $gettok($1-,1-,32) | haltdef } }
on ^!@*:action:*:#: { if ($nick isreg #) { .signal -n $gettok(e,1-,32) # $nick $gettok($1-,1-,32) | haltdef } }
on ^!@*:notice:*:#: { if ($nick isreg #) { .signal -n $gettok(e,1-,32) # $nick $gettok($1-,1-,32) | haltdef } }
on *:signal:*: {
if ($eval($signal) == c) { signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) ctcp }
if ($eval($signal) == r) { signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) ctcpreply }
if ($eval($signal) == e) {
if ($gettok($eval($regex($3-,/[[:cntrl:]]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) codes }
if ($gettok($eval($regex($strip($3-),/[[:upper:]]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) caps }
if ($gettok($eval($regex($strip($3-),/[[:digit:]]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) number }
if ($gettok($eval($regex($strip($3-),/[[:punct:]]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) symbol }
if ($gettok($eval($regex($strip($3-),/[ $chr(174) ]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) ascii }
if ($gettok($eval($level($strip($3-))),1-,32) == adv) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) advertise }
if ($gettok($eval($level($strip($3-))),1-,32) == bad) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) swear }
if ($gettok($eval($regex($strip($3-),/[ $chr(160) ]/g)),1-,32) > 49) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) blur }
if ($gettok($eval($regex($strip($3-),/[[:alnum:]]/g)),1-,32) > 199) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) lenght }
.hinc -u2m rep $gettok($eval($hash($+($gettok($1-,1-2,32),$remove($strip($3-),$chr(160),$chr(32))),32)),1-,32) | if ($hget(rep,$gettok($eval($hash($+($gettok($1-,1-2,32),$remove($strip($3-),$chr(160),$chr(32))),32)),1-,32)) > 2) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) repeat }
.hinc -u3m row $gettok($eval($hash($+($gettok($1-,1-2,32)),32)),1-,32) | if ($hget(row,$gettok($eval($hash($+($gettok($1-,1-2,32)),32)),1-,32)) > 4) { .signal -n $gettok(x,1-,32) $gettok($1-,1-2,32) row }
}
if ($eval($signal) == x) {
if ($gettok($1-,2,32) ison $gettok($1-,1,32)) {
.hinc -u3m d y
;if ($hget(d,y) > 19) {
.inc -u2 %dy
if (%dy < 22) { !.quote -qmcH kick $gettok($1-,1-2,32) $3 %logo }
.hadd -u2m o $+($2,*@*fake*)
.timer_ 1 3 !mode $chan $1 $+(+,$str(b,$hget(o,*).item)) $hget(o,1).item $hget(o,2).item $hget(o,3).item $hget(o,4).item $hget(o,5).item $hget(o,6).item $hget(o,7).item $hget(o,8).item $hget(o,9).item $hget(o,10).item $hget(o,11).item $hget(o,12).item }
}
}
on ^*:join:#: { halt }
on ^*:part:#: { halt }
on ^*:ban:#flood: { halt }
on ^*:unban:#flood: { halt }
on ^!*:kick:#: { halt }
raw 001:*:{ halt }
raw 002:*:{ halt }
raw 003:*:{ halt }
raw 004:*:{ halt }
raw 005:*:{ halt }
raw 006:*:{ halt }
raw 007:*:{ halt }
raw 008:*:{ halt }
raw 009:*:{ halt }
raw 250:*:{ halt }
raw 251:*:{ halt }
raw 252:*:{ halt }
raw 253:*:{ halt }
raw 254:*:{ halt }
raw 255:*:{ halt }
raw 265:*:{ halt }
raw 266:*:{ halt }
raw 494:*:{ halt }
raw 353:*:{ halt }
raw 367:*:{ halt }
raw 368:*:{ halt }
raw 401:*:{ halt }
raw 441:*:{ halt }
raw 442:*:{ halt }
raw 375:*:{ halt }
raw 376:*:{ halt }
raw 372:*:{ halt }
raw 302:*:{ halt }
raw 478:*:{ halt }

Thx! ..

Last edited by kein; 31/03/06 03:18 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
First suggestion, when posting code in the forum, use the Code Tags.

Second suggestion, in place of all those raws use
Code:
 raw *:*:{
 if $istok(1 2 3 4 5 6 7 8 9 250 251 252 253 254 255 265 266 494 353 367 368 401 441 442 375 376 372 302 478,$1,32) {
 halt
 }
}
 

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Not one of those $evals are necessary and some of your regexes could be made shorter (i.e. \d instead of [[:digit:]])

Joined: Mar 2006
Posts: 11
K
kein Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Mar 2006
Posts: 11
Sorry russelb its my fault. Thx for your comment.

Hixxy I dont get what you mean about the regexes.

Last edited by kein; 31/03/06 11:51 AM.
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
In a regex match, \d and [[:digit]] have the same meaning, so you can use them interchangebly. I don't see why one would not use the shorter of the two. Besides being shorter, the code looks cleaner.

Joined: Mar 2006
Posts: 11
K
kein Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Mar 2006
Posts: 11
Is it goes like this?

if ($gettok($eval($regex($strip($3-),\d)),1-,32) > 49)

RusselB .. I tested your codes but is still shown on my screen and not halted.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Most of your $gettoks can be changed:

$gettok(x,1-,32) is the same as just x
$gettok($1-,2,32) is the same as $2
$gettok($1-,1-2,32) is the same as $1-2
$gettok($eval($regex($strip($3-),\d)),1-,32) is the same as $eval($regex($strip($3-),\d)), but you do not need to $eval, so use: $regex($strip($3-),/\d/)

You should be using regex separators: /\d/

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:

RusselB .. I tested your codes but is still shown on my screen and not halted.

He put in $1 but meant $numeric
Code:
raw *:*:{
 if $istok(1 2 3 4 5 6 7 8 9 250 251 252 253 254 255 265 266 494 353 367 368 401 441 442 375 376 372 302 478,[color:red]$numeric[/color],32) {
 halt
 }
}


Link Copied to Clipboard