The . silences the command so there is no echo in the status window. It is not a text command.
Anyways, check this out. Same script jut written ... correctly?
on @$:TEXT:/(www\56|\57\57\56|\72\57\57|\43[a-zA-Z]www..com | www..org | www..net | www..tv | www..co.uk | www..biz)/iS::{
if ($nick !isop $chan) {
msg $chan $nick has been kicked due to advertisement
.kick $chan $nick you have been kicked due to advertisement, channel notified.
}
}
Not that I suggest using this code but check this out.
on !@:TEXT::#:{
if ($nick isowner #) { Return }
var %text = $hash($strip($1-),32), %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ], %temp, %count | %old.text = $deltok(%old.text,1,46)
if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) { set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text | return }
%temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] | %count = $gettok(%temp,1,46) | inc %count | set -u30 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text
if (%count >= 3) { .raw access $chan add deny $+(!, $Ial($nick).addr) 1 :Text-Flood | .raw kick # $nick : $+ flooding(gone for 60 seconds) | unset -u10 %rp.* }
}
LEss code is better yes. I was just showing other ways of doing it. Also, look into using elseif in these situations.
If you say:
if ($1 == .m) { command }
if ($1 == .q) { command }
if ($1 == .k) { command }
etc.
Even if it matches .m, which means it won't match any of the others, it will still go through each if statement till it gets to the closing bracket.
if ($1 == .m) { command }
elseif ($1 == .q) { command }
elseif ($1 == .k) { command }
Now this will only check until it gets a match and then it will stop.
lol, actually $iif is a bit slower than using if.
I was going to suggest not checking the comparison twice.
if (!$2) mode $chan +o $me
else { mode $chan +o $2 }
but safer to say ...
if ($2 ison $chan) { mode $chan +o $2 }
else { mode $chan +o $me }
I, however, prefer the method stated with the regex. One line that handles all modes. :)
on *:input:#:{
if ($1 == .m) { var %m2 = $iif($3 ison $chan,$3,$me) | mode $chan $2 %m2 }
elseif ($1 == .k) && ($2 ison $chan) { kick $chan $2 $3- }
}
example:
.m +v nickname
Does require more to type though.
Yeah that was my first thought. Better to write down the allowed urls. There are way less allowed urls than urls to kick for. You can't possibly think of all the urls you dont want posted in your room.
Also, I don't think it is wise to do a loop through every line in a text file for every text event.
I also don't see any flood protection. What does this code do during a text flood?