 |
BlackSmith Apprentice

Joined: 08 Dec 2002 Posts: 152
|
Posted: Tue Feb 06, 2007 3:34 pm
Yet another cmud conversion problem |
I have this nice thing that calculates how long my spell has been on.
Code: |
time_representer
%if( %mod( (%1)/3600, 3600) != 0, %mod( (%1)/3600, 3600)h%char( 32), "")%if( %mod( (%1)/60, 60) != 0, %mod( (%1)/60, 60)m, "")%if( %mod( (%1), 60) != 0, %char( 32)%mod( (%1), 60)s, "") |
But if i use it like this:
@time_representer(%ctime - @Spell.Time)
it gives me
(2117 - 1659)
in cmud. In Zmud it worked like a charm giving me results like
7mins 38secs |
|
_________________ BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient. |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Feb 06, 2007 9:12 pm |
You probably need a %int because the autotyping of the variable (a known bug) may not be happening. Or possibly but less likely you need an explicit %eval. Try the following.
@time_representer(%ctime - %int(@Spell.Time))
or this
@time_representer(%int(%ctime) - %int(@Spell.Time))
or this
@time_representer(%eval(%ctime - %int(@Spell.Time)))
The first one should do it though. |
|
_________________ Asati di tempari! |
|
|
 |
|
|
|
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
|
|