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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger Help

Trigger Help

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


Posted by Webkid   USA  (22 posts)  [Biography] bio
Date Wed 26 May 2004 10:24 PM (UTC)
Message
I was wondering if anyone could help answer my question. One one of the muds i play there is a command called Skills, which allows you to check to see what skills you know and the % of that skill. Below is an example:
skill % skill %
------------------------------ ------------------------------
alter : 26% intimidate : 20%
anatomy : 68% melee : 100%
bomb : 10% minor surgery : 87%
bomb construction : 5% power maul : 24%
climb : 4% rage : 100%
combine : 0% rally : 14%
construct : 3% reinforce : 9%
cureall : 22% relief effort : 6%
droid_repair : 1% resize : 2%
fasttalk : 28% scour : 100%
first aid : 91% security devices : 0%
haggle : 10% ship_repair : 1%
halting targets : 2% shop info : 34%
info : 1% weapon_repair : 35%
inspiration : 28% zoology : 68%
insult : 6%

It is two colum format like so:

Skill : 15% Skill2 : 9%

Is there anyway i can color each skill in different colums?

like skill : 15% would be red and and skill2 : 9% would be green, etc.

Sorry if im not being clear enough.

Thanks

-Webkid
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Wed 26 May 2004 11:28 PM (UTC)
Message
Is it possible, yes. Is it simple or easy, not particularly for a beginning scripter.

What you want is probably easiest to accomplish via gag and replace with a multiline trigger. (Lots and lots of examples if you want to attempt modifying one)

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Webkid   USA  (22 posts)  [Biography] bio
Date Reply #2 on Thu 27 May 2004 02:40 AM (UTC)
Message
An example or a few would be great :)

Thanx

-Webkid
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Thu 27 May 2004 03:31 AM (UTC)

Amended on Thu 27 May 2004 03:33 AM (UTC) by Flannel

Message

^(\w+) \: (\d{1,3})\% (\w+) \: (\d{1,3})%  $

Flags:
Enabled, RegExp, Ignore case, Omit From Output, Keep Evaluating

Send to: Script

Send:

ColourTell "red", "", "%1 : %2 "
ColourTell "green", "", "%3 : %4  " & VbCrLf


Turn it on with an alias that is also the command, turn it off... with a prompt, or something else.

For your last line (if it only has one), take the first half of the trigger, and the first line of the script. And make a new trigger.

Also, You might need to check the EXACT spacing, when I highlighted your post, it appeared to have two spaces afterwards, this might, or mightnt be the case, youll need to adjust your trigger accordingly.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Webkid   USA  (22 posts)  [Biography] bio
Date Reply #4 on Tue 01 Jun 2004 04:42 AM (UTC)
Message
Hrm, I'm still having trouble getting this to work. I took what I seen on my screen and converted it to html, hope that helps some. You can see it at: http://www.geocities.com/idjpg/skills.html

See the thing is my skill list varies, so i will need to make a trigger for each skill.

All I need to do is change the color of the text for each trigger match.

Like the alter skill + the : + the # and % sign would be darkgreen, intimidate would be cyan, etc. Does that make sense?

-Webkid
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Tue 01 Jun 2004 04:54 AM (UTC)

Amended on Tue 01 Jun 2004 05:09 AM (UTC) by Flannel

Message
Why dont you just make the skills variables? So that one trigger can match all of them? Or one each, perhaps one trigger matching a line of two. And then a final one for a single.

So, make triggers as follows:

^Skill1] : [Percentage1]\% [Skill2] \: [Percentage2]\%$

And then a final one which is merely:

^[skill] \: [percentage]\%$

(You need to add correct regexps for those, try to be as specific as possible, so, itd PROBABLY be (\w+) for the skill, and \d{0,3} for the percentage.)

The second trigger is just for a line with one thing, ie an odd number of skills.

Then just do the colortells, based on the percentages, just a series of if statements:

if percentage > 75
colortell "green", "", "%1 : %2%% "
elseif percentage > 50
colortell "cyan", "", "%1 : %2%% "

etc

and then repeat for the second half of the line, remember to add a VbCrLf.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Tue 01 Jun 2004 05:10 AM (UTC)
Message
Oh, now that I look at your link...

Ok, youll need to allow for all the spaces in your triggers. This is done with whitespace, either [ ]+ or something more specific, if you feel like making sure its formatted. Youll need to add whitespace as needed, and I suggest being as specific as possible (between 1 and 3 for between : and your percentage for instance).

This is the most likely cause of your current ones (whatever they are) not working. Also remember the spaces at the end of each line.

Youll also need to account for spaces in your skill catching.

(yes, I know I posted once after the other, I figured hed get bored with that post since its long, and then start reading the next post)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[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.


19,236 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 HostDash]