Ok, some problems with both scripts...
on @*:TEXT:*:#: {
if ($nick !isreg $chan) { [color:red]return[/color] }
if ($chr[color:red]([/color]35[color:red]) $+ * iswm[/color] $1-) {
mode $chan +b $address($nick,3)
kick $chan $nick No Advertising in $chan
}
}
Ok, some explanations...
* Return is a better way to leave a script than using halt.
* You forgot ()'s around the $chr number.
* This#is isn't a channel name and should get banned... using #* instead of *#* is more appropriate... hence the iswm part.
* Note that you could also use "ban -k" rather than two separate lines for banning/kicking people.
* You may also want to set it to only kick when the length of the #* is greater than 3. Why? If someone types #1, you don't want to ban them. So, checking length greater than 3 would allow #1 to #99 to be typed without a problem. And, most channel names are longer than 2 letters.
If you want to do the last part:
on @*:TEXT:*:#: {
if ($nick !isreg $chan) { return }
if ($wildtok($1-,$chr(35) $+ *,0,32) > 0) {
var %c = 1
var %i = $wildtok($1-,$chr(35) $+ *,0,32)
while (%c <= %i) {
if ($len($wildtok($1-,$chr(35) $+ *,%c,32)) > 3) {
ban -k $chan $nick 3 No Advertising in $chan
return
}
inc %c
}
}
}
The loop will have it check all occurences of #* in the text for length (up until it reaches one that has greater than 3 length).
Just a note on the /ban -k ... I can't test it right now and I'm not entirely sure if the 3 will still be counted as the ban mask type, or if it will be counted as the kick reason. It may be necessary to replace $nick with $address($nick,3) and remove the 3 after the $nick. If it works without doing that, then this is a better way by using /ban's internal mask option.