Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Wed Feb 16, 2005 10:11 pm   

Problem with counting
 
What I'm trying to accomplish is a trigger to count the number of skills I have at 100%.
I type prac and this is the output:

Code:
absolute zero      100%  acid blast         100%  acid breath        100% 
animate dead        91%  armor               98%  astral projection  100% 
betray              76%  blindness          100%  burning hands       75% 
call lightning      75%  cancellation        91%  cannibalism        100% 
chain lightning     88%  change sex          87%  charm person        92% 
chill touch         96%  colour spray        76%  continual light    100% 
control weather     80%  create food        100%  create spring       85% 
create water        75%  detect astral       97%  detect evil         76% 
detect good         75%  detect hidden       98%  detect invis        95% 
detect magic        80%  detect poison       75%  dispel evil         77% 
dispel good         75%  dispel magic       100%  electrocution       83% 
enchant armor      100%  enchant weapon     100%  energy drain       100% 
epidemic            97%  fade               100%  faerie fire         76% 
faerie fog          79%  farsight           100%  fear                77% 
feeblemind          77%  fire breath        100%  fireball            92% 
fireproof           76%  fly                 77%  floating disc       81% 
frost breath       100%  gas breath         100%  gate               100% 
giant strength     100%  hailstorm           75%  hand of siva        93% 
haste              100%  heat metal          95%  identify            85% 
immolation          80%  infravision         77%  invisibility        92% 
know alignment      80%  lightning bolt      79%  lightning breath   100% 
locate object       91%  magic missile      100%  mana shield         77% 
mass invis          80%  meteor swarm        76%  monsoon             77% 
necrosis            78%  nexus              100%  pass door           81% 
plague              80%  poison              82%  portal             100% 
protection evil     79%  protection good     88%  protection magic    84% 
recharge            75%  reflection          82%  refresh             91% 
renewal            100%  ritual sacrifice    93%  sanctuary          100% 
[Hit Return to continue]
 
shield              96%  shocking grasp     100%  sleep              100% 
slow                93%  stop               100%  stone skin          90% 
summon              91%  teleport            75%  ventriloquate       86% 
weaken              95%  word of recall     100%  dagger             100% 
mace               100%  polearm            100%  whip                99% 
hand to hand       100%  dodge              100%  meditation         100% 
lore               100%  arcane lore         79%  appraise            76% 
haggle              99%  scrolls             90%  scribe             100% 
alchemy             76%  staves              75%  wands               78% 
swimming            76%  arcana             100%  breathe water       75% 
flee               100%  focus              100%  recall              50% 
You have 3 practice sessions left.


I've tried a few approaches with no success whatsoever. Anybody can enlighten me on a good way to do this?
_________________
*ribbit*
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Feb 16, 2005 11:12 pm   
 
Code:
#VAR perc100 0


Code:
#REGEX {((?:.*?)100~%)} {#var line {%0};#while %regex(@line,"^(?:.*?)100%",len) {#add perc100 1;#var line %right(@line,@len)};#unvar line;#unvar len} "" {notrig}
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Wed Feb 16, 2005 11:17 pm   
 
Code:
#trigger {(%d)~% * (%d)~% * (%d)~%} {
#if (%1 = 100) {#add skill_count 1}
#if (%2 = 100) {#add skill_count 1}
#if (%3 = 100) {#add skill_count 1}}

#trigger {^You have (%d) practice sessions left.} {
#sub {You have %1 practice sessions left and @skill_count skills at maximum.}
#var skill_count 0}


You have 3 practice sessions left and 41 skills at maximum.
Reply with quote
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Thu Feb 17, 2005 12:27 am   
 
IT WORKS Surprised
I did not try Darkhael's method but Full Throttle's works perfectly.
I had tried a similar approach previously, I'm still not quite sure what went wrong, but thanks both of you for the quick replies.
_________________
*ribbit*
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net