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 ➜ Tips and tricks ➜ Trigger Passing On Text it reads

Trigger Passing On Text it reads

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


Posted by Savitar   (3 posts)  Bio
Date Sat 18 Feb 2006 06:10 AM (UTC)
Message
I'm not accustomed to scripting, or let's be honest I've got no real clue where to start. I'm just looking for some help setting up a Trigger and would be eternally grateful. Basically I want to be able to create a Trigger (under World Configuration -> Appearance -> Triggers of course) that when it receives something like:
(This is the literal way the line would show up.)
[Radio: (C) Broadband] Savitar says, "Yadda."

It sends back the parts inside the brackets as one colour and everything else as another colour.

Is this possible?


A second perhaps simpler question is, how do I perhaps match just the first part in Brackets to one colour, then have it use the 'Send' area of Triggers to send the rest. Is there some type of registrar code (for instance as PennMUSH has of %q1 or the standard %0) that would send everything else after a matched area?]

Thanks very much for any assistance anyone can offer.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 18 Feb 2006 10:26 PM (UTC)
Message
It isn't totally clear which parts of your example can vary:


[Radio: (C) Broadband] Savitar says, "Yadda."


However assuming that the name of the person, and what they say, are what vary, you could match on this:

Match: [Radio: (C) Broadband] * says, "*"

Then inside your "send" box the name (Savitar in this case) becomes %1 and what he says ("Yadda.") becomes %2.

To partially colour a line, you need a regular expression. This trigger would colour the stuff inside the brackets (and the brackets):


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^\[Radio\: \(C\) Broadband\]"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


11,047 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.