So this is a weird one but i have a code for a link protection with my chat bot that works if if put it at the top of the page in the remote scripts editor, but none of my other commands work if I do that. If I put the code at the bottom, underneath all the other commands the link protection doesn't work but all my other commands work.
I have a lot of commands, although most are just simple text responses. here is the code, any thoughts?
on @*:text:*:#:linkpost $1-
on @*:action:*:#:linkpost $1-
on @*:notice:*:#:linkpost $1-
alias -l linkpost {
if ((!%p) && (!$hfind(permit,$nick))) { inc -u4 %p
var %purge /^!(link\so(n|ff)|(permit))\b/iS
var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
var %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) {
timeout # $nick | /mode # -b $nick
msg # Omnomnom, $nick thanks for the yummy link sbzyChicken
msg # /timeout $nick 1
}
elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) {
hadd -mz permit $v1 30 | notice $v1 You have 30 seconds to post a link. Starting now!
msg # You now have 30 seconds to post a link! Gogogogo PogChamp
}
elseif (($regml(1) = link on) && ($nick isop #)) {
goto $iif(!$istok(%chanon1,#,32),a,b) | :a | set %chanon1 $addtok(%chanon,#,32)
.msg # Yes! I was getting hungry AtIvy
halt | :b | .msg # $nick $+ , I am already hunting GasJoker
}
elseif (($regml(1) = link off) && ($nick isop #)) {
goto $iif($istok(%chanon1,#,32),c,d) | :c | set %chanon1 $remtok(%chanon,#,1,32)
.msg # Awww, but I'm still hungry DansGame
halt |
| .msg # $nick $+ , It wasn't me! I'm not hunting! BrainSlug
!
}
}
}