|
Lasivian Wanderer
Joined: 25 Jan 2002 Posts: 76 Location: USA
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
|
|
|