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
illyism
Wanderer


Joined: 09 Dec 2007
Posts: 58

PostPosted: Fri May 02, 2008 10:59 pm   

counting up without receiving the trigger(again)
 
well, the problem is. if I make a trigger, let's say to do something and then add to it so the next one get another result.

#if (@num=1) {#echo do 1;#var num %mss(@num+1)}
#if (@num=2) {#echo do 2;#var num %mss(@num+1)}

this will send both of them at once.

this is the entire script I have trouble with.

#CLASS {skills|oracle}
#VAR fisticuffspercent {38}
#VAR defencepercent {38}
#VAR perceptionpercent {38}
#VAR scholarshippercent {38}
#VAR constitutionpercent {38}
#VAR itemlorepercent {38}
#VAR ridingpercent {38}
#VAR swordplaypercent {38}
#VAR survivalpercent {38}
#VAR throwingpercent {38}
#VAR trappingpercent {38}
#VAR poisonspercent {38}
#TRIGGER {before revealing that you are (%d)~% of the way} {#var percentage %1;#if (@oraclenum=1) {#var fisticuffspercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=2) {#var defencepercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=3) {#var perceptionpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=4) {#var scholarshippercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=5) {#var constitutionpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=6) {#var itemlorepercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=7) {#var ridingpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=8) {#var swordplaypercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=9) {#var survivalpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=10) {#var throwingpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=11) {#var trappingpercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)};#if (@oraclenum=12) {#var poisonspercent @percentage;#wait 250;#var oraclenum %mss(@oraclenum+1)}}
#class 0

as you can see, it will detect the first percentage, and count up on oraclenum and place that percentage on every skill.
and the next trigger that I receive won't get past #if, because oraclenum is alredy above the second number which it should receive.

...

do any of you have a solution for this problem?
I want to detect 1, and when the trigger hits again, detect 2, and when that trigger hits again, detect 3 and so on.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat May 03, 2008 4:48 pm   
 
I'd suggest using #add oraclenum 1 instead of #var oraclenum %mss(@oraclenum+1) for a start. Also how does oraclenum get set initially as your script doesn't define it rather just assumes it exists at the start of the trigger script?
_________________
Taz :)
Reply with quote
illyism
Wanderer


Joined: 09 Dec 2007
Posts: 58

PostPosted: Sun May 04, 2008 7:18 pm   
 
that alias is set in class skills. which sets it as #var oraclenum 1
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 7:26 pm   
 
You shouldn't be using %mss in this situation, Taz is correct. You have two solutions to your problem really:

1) reverse the order of the statements so that 2 comes before 1.
2) use #case instead.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun May 04, 2008 8:06 pm   
 
This does what you asked for, but it really is a horrible way of doing things. If you gave us the full text you are looking to capture and what you want to do with it later we can probably suggest better ways of doing it.
Code:
#CLASS {skills|oracle}
#VAR fisticuffspercent {38}
#VAR defencepercent {38}
#VAR perceptionpercent {38}
#VAR scholarshippercent {38}
#VAR constitutionpercent {38}
#VAR itemlorepercent {38}
#VAR ridingpercent {38}
#VAR swordplaypercent {38}
#VAR survivalpercent {38}
#VAR throwingpercent {38}
#VAR trappingpercent {38}
#VAR poisonspercent {38}
#VAR OracleNames {fisticuffs|defence|perception|scholarship|constitution|itemlore|riding|swordplay|survival|throwing|trapping|poison}
#TRIGGER {before revealing that you are (%d)~% of the way} {#var {%concat(%item(@OracleNames,@oraclenum),"percent")} %1;#ADD oraclenum 1}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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