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
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Thu Jan 09, 2003 2:59 am   

user functions
 
this is one i have, that is supposed to make it easier for me to use the %secs variable:
#var time {(%1*60*60*1000)+(%2*60*1000)}

but i can't get it to work...

when i do
#echo @time(20, 42)
i just get
(20*60*60*1000)+(42*60*1000)

#echo %eval(@time(20, 42))

just gives me a blank line

any hints or suggestions?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 09, 2003 3:29 am   
 
#FUNC time {%eval((%1*60*60*1000)+(%2*60*1000))}

Kjata
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Thu Jan 09, 2003 4:45 pm   
 
thanks, that worked, but now my trigger isn't :(

#func time {(%1*60*60*1000)+(%2*60*1000)}
#TRIGGER (%secs = @time(10,29)) {#echo time is 10:29}

but the right time goes by without anything happening
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 09, 2003 4:55 pm   
 
Triggers don't work like that. Try using an alarm instead:
#ALARM {*0.1} {#IF (%secs = @time(10,29)) {#echo time is 10:29}}

The alarm fires every .1 seconds (there is a limit to how short the period can be, .1s is not it, but it is very short). Of course, the alarm would have to fire exactly when the time is 10:29 with no miliseconds. This means, that this approach is not the best one. Try looking into the %time function instead.

Kjata

Edited by - tondiening on 01/09/2003 20:49:05
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 10, 2003 6:56 pm   
 
You don't need %secs for this
#ALARM 10:29:00 {#ECHO time is 10:29}

Perhaps you could give us your real use for the function?

LightBulb
Senior Member
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