Code:
 
ctcp !@*:*:#: { if ($nick isreg #) { .signal -n a # $nick | haltdef } } 
on !@*:ctcpreply:*: { if ($nick isreg #) && ($me isop #) { .signal -n b # $nick | haltdef } } 
on ^!@*:text:*:#: { if ($nick isreg #) { .signal -n c # $nick $1- | haltdef } } 
on ^!@*:action:*:#: { if ($nick isreg #) { .signal -n c # $nick $1- | haltdef } } 
on ^!@*:notice:*:#: { if ($nick isreg #) { .signal -n c # $nick $1- | haltdef } } 
on *:signal:*: {
  $iif($signal == a,.signal -n d $1-2 ctcp)) 
  $iif($signal == b,.signal -n d $1-2 ctcpreply)) 
  if ($signal == c) { 
    $iif($regex($3-,/[[:cntrl:]]/g) > 49,.signal -n d $1-2 codes))
    $iif($regex($3-,/[[:upper:]]/gS) > 49,.signal -n d $1-2 caps)) 
    $iif($regex($3-,/\d/gS) > 49,.signal -n d $1-2 number)) 
    $iif($regex($3-,/[[:punct:]]/gS) > 49,.signal -n d $1-2 symbol))
    $iif($regex($3-,/[ $chr(174) ]/gS) > 49,.signal -n d $1-2 ascii))
    $iif($regex($3-,/[ $chr(160) ]/gS) > 49,.signal -n d $1-2 blur)) 
    $iif($regex($3-,/./gS) > 199,.signal -n d $1-2 lenght))
    $iif($regex($remove($3-,$chr(40),$chr(41)),/(?:^|(\40|\240))((http+(:|s:)\/\/\S*)|((www\.{1})+(.*)+(\.{1})+(\w{2,3})\S*)|#[^\40]\S*)/Si),.signal -n d $1-2 advertise))
    $iif($regex($3-,/\b([censored]||suck|[censored]|bitch|dick)\b/Si),.signal -n d $1-2 swear))
    .hinc -u5m row $+($1,$2) 1 
    if ($hget(row,$+($1,$2)) > 4) { .signal -n d $1-2 lines }
    hinc -u5m rep [ $+ [ $1 ] $+ [ $2 ] ] $hash($remove($3-,$chr(160),$chr(32)),32) 1 
    if ($hget(rep [ $+ [ $1 ] $+ [ $2 ] ],$hash($remove($3-,$chr(160),$chr(32)),32)) > 2) { .signal -n d $1-2 repeat }
  } 
  if ($signal == d) { 
    if ($2 ison $1) { 
      .hinc -mu20 d y  
      if ($hget(d,y) < 22) { !kick $1 $2 $3 }
  }
}

 


I need chan protection with fast detect and kick. Now i just wanna ask few question how can i modify codes above works more faster. I dont mind if the codes looks complicated as long as its can works faster. The questions is refer to the codes above wink

1. Is it using to many "|" makes my codes works slower?
eg:
if bla bla
if bla2 bla2

better than

if bla bla | if bla la

2. Which one is better ?
a.
if bla bla

b.
$iif bla bla

3. if $iif .. is it makes it one line is better ?
eg:
$iif bla bla,$iif bla2 bla2

4. Is that haldef is better using on event either than halt?

5. Signal is better than using aliases

6. What is the best way to detect only a letter .. $regex ?
eg:
[ $chr(160 ]

7. Which is better(faster)
a.
if $regex bla bla
b.
hadd a b
$hget a b $regex bla bla
c.
var %dll = $scriptdiraircdll.dll $regex bla
if +flood

8. What is better using on kick limit
a.
%n < 0 halt
%n >= 22 halt
b. isnum (0-21)

last
- What should i edit codes above for overall. Hopefully with an example.

I think thats all for now. Sorry if im asking stupid question. I will greatfull if many ppl give some comment/answer. Thanks