colors?

Posted by Zendu on Thu 06 May 2004 11:17 PM — 11 posts, 33,113 views.

#0
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
Amended on Thu 06 May 2004 11:27 PM by Zendu
USA #1
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.
#2
I need to color only a specific range of numbers, 26 and below for example
USA #3
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.
#4
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
USA #5
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.
#6
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
USA #7
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.
#8
Not very often do i say "OOOHHHH" outloud, thanks for breaking it down for me instead of just showing me it
Australia Forum Administrator #9
Yes, cute. Remember in regexps you can do a range, so:

[0123456]

can become:

[0-6]
#10
Well i whould change it, but ive changed it once allready.. thanks though i will be sure to use that later