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
Amaya
Newbie


Joined: 02 May 2002
Posts: 1

PostPosted: Thu May 02, 2002 3:22 am   

Timer Plugin?
 
Anyone have any idea if there's a way to time between text strings to the tenths of a second? (or more?) For example finding the exact time between:

You swing a longsword!



You have regained balance.

I don't think Zmud's timer does tenths of seconds...does anyone know a way?

Thanks!
Amaya
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu May 02, 2002 4:25 am   
 
quote:

Anyone have any idea if there's a way to time between text strings to the tenths of a second? (or more?) For example finding the exact time between:

You swing a longsword!



You have regained balance.

I don't think Zmud's timer does tenths of seconds...does anyone know a way?

Thanks!
Amaya



hmm, nothing comes to mind, but what about utilizing %time()? I don't remember if it's limited to seconds, but it probably is. IF it is not, then simply have each trigger record the time and then compare them. This might have to be a string comparison, and it might be big and klunky, so be prepared to fry some grey matter.

li'l shmoe of Dragon's Gate MUD
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Thu May 02, 2002 7:49 am   
 
You can use %secs to get an accuracy of at least 0.1 seconds.
(In theory time resulution is 10 ms, but I have some doubts there)

#TRIG {You swing a longsword!$} {#VAR swingtime %secs}
#TRIG {You have regained balance.$} {#SH %eval(%secs-@swingtime) ms have passed.}

now
#SH You swing a longsword!
#ALA +2 {#SH You have regained balance.}

gives the output '2030 ms have passed.' or a number close to that - on my system.

Note:
%secs 'wraps' at midnight, so if you get a strange negative number displayed you should just go to bed
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