mIRC Home    About    Download    Register    News    Help

Print Thread
#248360 05/10/14 08:01 AM
Joined: Oct 2014
Posts: 8
M
MsDiz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2014
Posts: 8
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 | laugh | .msg # $nick $+ , It wasn't me! I'm not hunting! BrainSlug
!
}
}
}

Last edited by MsDiz; 05/10/14 08:02 AM.

Total n00b smirk
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Click File > New, and paste the code in there.
You have them all in one remote file, which means that your text events will always trigger to the one at the top, (on @*:text:*:#:linkpost $1-) which triggers on all text.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Oct 2014
Posts: 8
M
MsDiz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2014
Posts: 8
oohhhhh, that makes so much sense, thank you so much laugh


Total n00b smirk

Link Copied to Clipboard