 |
Amaya Newbie
Joined: 02 May 2002 Posts: 1
|
Posted: 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 |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
 |
Sildaren Wanderer
Joined: 19 Jul 2001 Posts: 59 Location: Germany
|
Posted: 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  |
|
|
 |
|
|