Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Replace trigger

Replace trigger

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Vercalos   (23 posts)  Bio
Date Thu 10 Mar 2005 09:40 AM (UTC)
Message
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.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Thu 10 Mar 2005 12:50 PM (UTC)
Message
You need to set the "* fool *" trigger to omit from output, so that the original output isn't displayed.
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #2 on Thu 10 Mar 2005 05:09 PM (UTC)
Message
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.
Top

Posted by Vercalos   (23 posts)  Bio
Date Reply #3 on Thu 10 Mar 2005 07:11 PM (UTC)
Message
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.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #4 on Fri 11 Mar 2005 05:09 AM (UTC)
Message
Whats the trigger you're using? (Copy/paste it here, the whole trigger just the match, use the copy button on the triggers menu)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Vercalos   (23 posts)  Bio
Date Reply #5 on Fri 11 Mar 2005 05:17 AM (UTC)

Amended on Fri 11 Mar 2005 05:25 AM (UTC) by Vercalos

Message
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
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #6 on Fri 11 Mar 2005 05:22 AM (UTC)
Message
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).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Vercalos   (23 posts)  Bio
Date Reply #7 on Fri 11 Mar 2005 05:38 AM (UTC)
Message
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
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


23,201 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.