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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Match part of trigger color

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Match part of trigger color
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 12 Feb 2010 04:29 AM (UTC)  quote  ]
Message
See:

http://www.gammon.com.au/scripts/doc.php?dialog=IDD_EDIT_TRIGGER

In particular:


If you use "send to script (after omit)" then the style runs are also available from the global variable: TriggerStyleRuns.


So, either use a script function, in which case the styles are the 4th argument, or change it to "send to script (after omit)" and then use:


style = GetStyle (TriggerStyleRuns, 10)


Then check style.textcolour.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Fri 12 Feb 2010 04:24 AM (UTC)  quote  ]
Message
<triggers>
  <trigger
   enabled="y"
   group="wand"
   match="The \w+ of the wand glows"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>require "getstyle"

 style = GetStyle (styles, 10)

</send>
  </trigger>
</triggers>


From what I remember triggers had an implicit arg passed to it called styles, along with line, wildcards etc. Maybe not.

I then need to check the color of the arg to see if it's red.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 12 Feb 2010 04:05 AM (UTC)  quote  ]
Message
Can you post your trigger please?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Fri 12 Feb 2010 03:47 AM (UTC)  quote  ]
Message
Not sure I follow. You mean I need to change my trigger to match the color instead of looking for that in the Send?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 11 Feb 2010 03:21 AM (UTC)  quote  ]
Message
The style runs as supplied to your trigger.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Thu 11 Feb 2010 03:15 AM (UTC)  quote  ]
Message
Yeah I read that post and it only provides examples of functions, unless I'm missing something. I guess I'm wondering what the first arg of getstyles would be then.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 11 Feb 2010 03:10 AM (UTC)  quote  ]
Message
It is more or less covered here:

Template:post=7818 Please see the forum thread: http://gammon.com.au/forum/?id=7818.


In essence, getstyle gives you the colour if you know the column, and in your case you do (it's column 5).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Thu 11 Feb 2010 03:03 AM (UTC)  quote  ]
Message
I'm trying to remember how to match on (part) of a triggers color. There's a line like "The <noun> of the wand glows." where I need to match if the word color is red. My regex is more or less "The * of the wand glows".

I see getstyle, but I don't know how to have it match arg1 (%1) for this trigger.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[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.


2,342 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]