What script would i use if i wanted a message to play everytime i got slapped?
Sorry about that, had something extra that wasn't needed
on *:ACTION:*:#:{
var %m = /\bslaps\b.*\b\Q $+ $replace($me,\E,\E\\E\Q) $+ \E\b/iS
if ($regex($1-,%m)) {
msg $chan DON'T SLAP ME!
}
}
;Edited to fix code
Hmm, thanks, but it doesnt seem to work. I put it in the remotes tab in script editor.
I edited the code. It should work now
Froggie, why not use the on action regex instead:
on $*:ACTION:$(/\bslaps\b.*\b\Q $+ $replace($me,\E,\E\\E\Q) $+ \E\b/iS):#:{
msg $chan DON'T SLAP ME!
}
You save yourself an if statement and a local variable. A trigger flood control may be put into consideration so the client that runs the code doesn't get scrolled.
A small criticism: You should use $replacecs() instead of $replace(), as the \Q...\E sequence is case-sensitive. An \e would not end the escape sequence, as you can see here:
//echo -a $regex(\e,/^\Q\e\E$/)
Can anyone be so kind to explain to me why the $replacecs() is or has to be used? In other words, what's the main role it plays?
Hixxy's post is quite clear, \E isn't the same as \e in regex, $replace could return an invalid string
Hixxy's post is quite clear, \E isn't the same as \e in regex, $replace could return an invalid string
I think I worded my say in a confusing manner. I was asking for an explanation of why the the identifier $replace should be utilized in the regex pattern. Again, I'm not asking for an answer to the difference between $replace() and $replacecs(); I'm asking about the necessity behind it.
Ah sorry, then it's because \E could be in $me, which would be problematic for the regex pattern
Hmm neither seems to work.
on $*:ACTION:$(/\bslaps\b.*\b\Q $+ $replace($me,\E,\E\\E\Q) $+ \E\b/iS):#:{
msg $chan UNINSTALLRO, UNINSTALLRO~ UNI UNINSTALLRO, UNI UNINSTALLRO ~♪
}
I put that in my remotes tab and nothing happens when i get slapped.
Also, how do i change the color of the text that appears?
The code is working fine for me:
on $*:action:$(/\bslaps\b.*\b\Q $+ $replacecs($me,\E,\E\\E\Q) $+ \E\b/iS):#:{
msg # UNINSTALLRO, UNINSTALLRO~ UNI UNINSTALLRO, UNI UNINSTALLRO ~♪
}
I'm not certain why it fails on you. The only thing I can think of is to make sure your remote is on by entering: /remote on
What color of text do you want it to appear?
Oh, i figured it out, i was trying to slap myself but the message wasnt triggering. It seems to only trigger if someone else slaps me.
I was thinking pink?
Nice going dude...it takes you like two weeks to figure this out. lol
From the help file under ON TEXT
Note: You cannot test out these events by typing text to yourself. They can only be initiated by someone else saying something in a channel or in a private message.
So how do i change it to pink?
The same way you would type a message in a color. Put Ctrl-K and the color number into the message.