|
resinoid Newbie
Joined: 02 Sep 2009 Posts: 3
|
Posted: Thu May 07, 2015 10:14 am
Help with counting symbols |
Hi all...I'm not very good at trigger coding and wondered if any of you could help me out. What i am trying to do is a simple addition of 5 different symbols in a line. There are a total of 20 spaces for the symbols....this is the example
[###########*________]
variables for this are:
# =5
@ =4
* =3
: =2
. = 1
_ = 0
So, the above example would be equal to 58%
If anyone can help it would be much apprecialted.....thanks |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu May 07, 2015 12:38 pm |
Based on your example all that needs to be counted are the number signs and the single character after them.
#REGEX {^[([#]*)(.)} {#SHOW {%eval(5*%len(%1)+%ismember(%2,".|:|*|@"))}} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
resinoid Newbie
Joined: 02 Sep 2009 Posts: 3
|
Posted: Thu May 07, 2015 6:06 pm |
Thanks for the response. Is there a way to when looking at an item to give a percent next to the bracketed symbols. This is what it looks like:
The Paingiver's runes are glowing eerily: [###########*________]
And somehow when I look at the item it give a description:
The Paingiver's runes are glowing eerily: [###########*________] {58%}
Thanks again for the response, really appreciate the help |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun May 10, 2015 10:46 pm |
#REGEX {[([#]*)(.)[_]*(])$} {#PSUB {%concat("{",%eval(5*%len(%1)+%ismember(%2,".|:|*|@")),"}")} %eval(%word(%x3,2)+2)}
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|