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


Joined: 25 Jan 2002
Posts: 76
Location: USA

PostPosted: Mon Dec 31, 2007 10:17 pm   

coding problem
 
The help files says this "SHOULD" work, but it's not.

The trigger fires, but remainkills is always 0 and "lvlg" always fires.

Trigger: You receive &killxp of &killxptotal experience points.

#math remainkills @xptonl/@killxp
#echo <@remainkills> more kills of this monster to your next level
look in cor
#IF (@remainkills < 2 and @remainkills > 0) {#IF (@lvlgear =~ "false") {lvlg}}


thanks
Reply with quote
Taz
GURU


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

PostPosted: Tue Jan 01, 2008 1:47 am   
 
If the trigger fires then you will be able to look in the settings editor and see that killxp and killxptotal have been populated which I would imagine they have.

Check the math line by itself from the command line to check it does what you expect or just replace it with #var remainkills %eval(@xptonl/@killxp) or perhaps even use a minus sign rather than a divides as I suspect you mean to use.

I'm thinking for the levelling gear you are checking if a variable is true and if so issuing a command to put on your levelling gear. Swap the variable contents to 1 and 0 and also your logic #IF (@lvlgear) {lvlg}

EDIT: A note about zMUD maths is that it is integer based so if the values are right then 0 would be returned. To force the division to become floating then use %float(@xptonl)/@killxp this makes sense since you are checking > 0 and < 2 which in integers you could have just checked for = 1
_________________
Taz :)
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