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
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Wed Apr 21, 2004 10:18 pm   

Level and Prac
 
I need something that computes how many times you need to die to get your practices reset.

All I've got so far is this:

#ALIAS level {#VAR level1 %1}

which sets the variable level1 to %1
Now I need an alias that takes the variable level1, divides it by 10, adds one, and does #SAY the result. I would also like a trigger that removes 1 from level1 for the text 'Ouch, you lose a level.'

Can someone help me? I have no idea about how to do this.
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Wed Apr 21, 2004 10:42 pm   
 
I've got it mostly done. I have a trigger reprac to do:

#eval @clevel/10+1

But I need it to round @clevel/10 before it adds one.
I need it to round like this: x.5 or higher rounds up. Below x.5 rounds down. So if @clevel=15... @clevel/10=1.5 I need it to round that to 2, than add 1.

I also need a trigger still to subtract 1 from clevel for the message:

Ouch, you lose a level.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Apr 21, 2004 11:18 pm   
 
Try this:
#trigger {Ouch, you lose a level.} {#add CLevel1 -1}

As for the rounding, I don't have a clue how you'd do it =P
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Apr 22, 2004 12:52 am   
 
Rounding made easy
#eval @clevel/10+(@clevel10)/5+1
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