 |
Elros Newbie
Joined: 13 Apr 2004 Posts: 3
|
Posted: Tue Apr 13, 2004 10:03 pm
Zmud not returning fractions... |
I am trying to write a trigger that calculates my experience gain per hour, have almost got it except Zmud wont return a fraction when i use the #math funtion. I want to divide a variable by 60 and need to keep the fractions. Can anyone help? My line looks like this
The mxptime variable below is minutes 1-60
#math dmxptime {@mxptime/60} <----- This is the bit that wont work
#math xptime {@hxptime+@dmxptime}
#math xpperhour {@xponrun/@xptime}
Thanking you in advance, Elros. |
|
|
 |
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Wed Apr 14, 2004 12:06 am |
If one of the operands is a floating point number the result will be too too force this, use %float
#math dmxptime{%float(@mxptime)/60} |
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Apr 14, 2004 12:10 am |
try this might work with #math but I havn't tested it
#math dmxptime {%float(mxptime)/60}
if that doesnt work use this.
dmxptime=%eval(%float(@mxptime)/60)
And also read the helpfiles for %float and the various related commands and functions, also doing a forum search http://www.zuggsoft.com/forum/search.asp I believe will yield A few examples to use to get it to work. |
|
|
 |
Elros Newbie
Joined: 13 Apr 2004 Posts: 3
|
Posted: Wed Apr 14, 2004 12:27 am |
Thanks a lot :) works perfectly
|
|
|
 |
Elros Newbie
Joined: 13 Apr 2004 Posts: 3
|
Posted: Wed Apr 14, 2004 12:45 am |
Sorry to ask again, but i have another question on the same trigger... When the time goes past 12 midnight it sets to 00.00 on Zmud thus screwing up the xp per hour trigger i have because i now get minus values for the time. Can anyone think of a statement to put in the trigger, or any way to rectify it that when it goes midnight i still get an accurate display of the xp gain per hour? I'll post the trigger ive got for the time below, thanks for your help! :)
#IF (@xponrun > 1000) {
time2=%time( hh.mm)
htime2=%time( hh)
mtime2=%time( nn)
}
#math hxptime {@htime2-@htime1}
#math mxptime {@mtime2-@mtime1}
#math dmxptime {%float( @mxptime)/60}
#math xptime {@hxptime+@dmxptime}
#math xpperhour {@xponrun/@xptime}
#math kxpperhour {@xpperhour/1000}
#math fkxpperhour %format( 2, @kxpperhour)
#math fxptime %format( 2, @xptime)
the time started i did in another trigger... Any help you could give would be much appreciated :)
Elros |
|
|
 |
|
|