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 ➜ General ➜ colors?

colors?

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


Posted by Zendu   (66 posts)  Bio
Date Thu 06 May 2004 11:17 PM (UTC)

Amended on Thu 06 May 2004 11:27 PM (UTC) by Zendu

Message
What are the commands for making something red/green?



Specifcally im making a tigger like this
Some prickly ash bark *:*gp

if %2< 25 gold then
send [green!]
if %2> 25 gold then
send [Red]


now that i look at it.. the green is really the only neccisary one

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 07 May 2004 01:45 AM (UTC)
Message
You mean... making the line a certain color? In the trigger option, just change "Change colour and style to: (no change)". You can change it to any of the Custom colors.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #2 on Fri 07 May 2004 02:34 AM (UTC)
Message
I need to color only a specific range of numbers, 26 and below for example

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #3 on Fri 07 May 2004 03:01 AM (UTC)
Message
Hmm.

^Some prickly ash bark (.*):([1]\d|2[0123456]|\d) gp

That would look for: a 1 followed by 'any' digit OR 2 followed by a 0, 1, 2, 3, 4, 5 or 6 OR any single digit by itself. So, anything from 0 to 26, but not higher. Just make sure to click the check box next to 'Regular Expression'. You may also have to adjust for correct spacing, like if the line reall appears as:

Some prickly ash bark blah : 23 gp

then you will need to add in the spaces before and after the ':' to fix it.
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #4 on Sat 08 May 2004 12:39 AM (UTC)
Message
I know nick is going to hate this, but the only way its worked so far is

^(.*?)Some prickly ash bark (.*?) \: (1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25)gp

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #5 on Sat 08 May 2004 01:34 AM (UTC)
Message
I tested my version and it works correctly. However, as I mentioned, you never gave an actual line showing what arrived and "gasp!" you have a space after the : in yours that mine didn't account for. Add that space, so it is:

^Some prickly ash bark (.*): ([1]\d|2[0123456]|\d) gp

and it should work. Though, from what yours shows, you may need to add .* to the start. You only need () around something if it is a) a sub string and/or b) you want to return it in a wild card, so you don't need the () around any .* parts you don't actually need for something.
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #6 on Sat 08 May 2004 02:09 AM (UTC)
Message
My only problem with your way, is that does it count if something it say... 8 gold?

And yes i do need a wildcard in the begining, i forgot about the invintory in the begining

(128)some prickly ash bark "ash10888": 25gp

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #7 on Sat 08 May 2004 02:25 AM (UTC)
Message
It does count things like 8 gold. I tested it with random values from 1 to 29, to check all cases. Basically it does:

[1]\d = A 1 followed by a single number.
| = OR
2[0123456] = 2 followed by 0 through 6
| = OR
\d = Any single digit.

Thus it will match anything from 0 to 26, but nothing over that.
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #8 on Sat 08 May 2004 09:00 AM (UTC)
Message
Not very often do i say "OOOHHHH" outloud, thanks for breaking it down for me instead of just showing me it

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Nick Gammon   Australia  (23,131 posts)  Bio   Forum Administrator
Date Reply #9 on Mon 10 May 2004 06:48 AM (UTC)
Message
Yes, cute. Remember in regexps you can do a range, so:

[0123456]

can become:

[0-6]

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #10 on Tue 11 May 2004 03:45 AM (UTC)
Message
Well i whould change it, but ive changed it once allready.. thanks though i will be sure to use that later

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
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.


23,069 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.