Replace trigger

Posted by Vercalos on Thu 10 Mar 2005 09:40 AM — 8 posts, 32,262 views.

#0
Is there any way to make a trigger that will replace something on before it reaches the screen?

Like

Alaywin says(OOC), "You bloody fool! How could you do something so ridiculous?"

gets replaced with

Alaywin says(OOC), "You bloody f--! How could you do something so ridiculous?"

I was thinking a trigger like
To Match
* fool *
Send to Output
%1 f-- %2

would work, but it didn't when I tested it.
Russia #1
You need to set the "* fool *" trigger to omit from output, so that the original output isn't displayed.
#2
With the example you give here, fool is followed by an exclamation point and will not match on * fool *. I'd suggest trying a regular expression to match the word(s) you want to replace and capturing everything before and after the word. Also, consider that the word may appear multiple times on the same line.
#3
I did the omit from output when I tested it, but all it did was send a blank line to the output window instead. It didn't capture the text for some reason.
USA #4
Whats the trigger you're using? (Copy/paste it here, the whole trigger just the match, use the copy button on the triggers menu)
#5
Nevermind... I just got it to work as I wanted to.

Actually, my purpose for making this trigger is that I'm rather designing my own IRC shell within MUSHclient, and I didn't want to have to keep looking at the server information
Amended on Fri 11 Mar 2005 05:25 AM by Vercalos
USA #6
You might also try using OnPluginPacketReceived since you'll be able to sort it out before triggers/colors/etc (to retain your colors, and keep it as an output line).
#7
I don't know the first thing about coding. I've tried writing scripts before but it didn't work. And as for colors, I haven't figured out how to get the client to interperet IRC colors, but others have indicated this would take more scripting.

Here's the trigger anyway, and it's specific for this IRC server.

<triggers>
<trigger
enabled="y"
match=":*!*@* PRIVMSG #ClanBOB :*"
omit_from_output="y"
send_to="2"
sequence="100"
>
<send>&lt;%1&gt; %4</send>
</trigger>
</triggers>

It works. Instead of seeing
:user!user@132.3443.4455 PRIVMSG #ClanBOB : Hiya

I see
<user> Hiya