[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Replace trigger
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Replace trigger

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


Posted by Vercalos   (23 posts)  [Biography] 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.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] 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.
[Go to top] top

Posted by Vercalos   (23 posts)  [Biography] 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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Vercalos   (23 posts)  [Biography] 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
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Vercalos   (23 posts)  [Biography] 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
[Go to top] 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.


5,616 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]