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
➜ Trigger Help
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Webkid
USA (22 posts) 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 | Top |
|
Posted by
| Meerclar
USA (733 posts) 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 | Top |
|
Posted by
| Webkid
USA (22 posts) Bio
|
Date
| Reply #2 on Thu 27 May 2004 02:40 AM (UTC) |
Message
| An example or a few would be great :)
Thanx |
-Webkid | Top |
|
Posted by
| Flannel
USA (1,230 posts) 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. | Top |
|
Posted by
| Webkid
USA (22 posts) 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 | Top |
|
Posted by
| Flannel
USA (1,230 posts) 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. | Top |
|
Posted by
| Flannel
USA (1,230 posts) 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. | 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.
22,301 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top