Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed Jan 21, 2009 2:00 am   

Display time since I've last seen this line?
 
I've been digging over all kinds of time variables and the docs trying to figure out how to show how much time has passed since I last saw a certain line. Is it possible? I know I've seen it on someone else client in the past.
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jan 21, 2009 3:01 am   
 
#tr {line you want to capture} {#lua {zs.var.currenttime=os.time(t)};$dtime=(@currenttime-@lasttime);#print Delta time: $dtime;#lua {zs.var.lasttime=os.time(t)}}
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed Jan 21, 2009 3:10 am   
 
Was looking for more of a way to put it into the statusbar to show how long it has been since that.

Like this line.

[centre of the encampment]
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Jan 21, 2009 5:01 am   
 
Just put the result of the local variable $dtime into a regular variable and put that in your status bar. If you want a running count you can look in to using the #TIMER or use a 1 second repeating #ALARM and have that alarm keep updating the variable you place in the status bar.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Jan 21, 2009 8:44 am   
 
Like so:

#trig {line I want to track} {time=%secs}

#alarm 1 {lastseen=%secs-@time}

Then you put @lastseen in the status bar. The alarm can be set to update at any frequency and it'll still work, if you're finding one-second updates to be too resource-intensive. %secs, by the way, contains the number of seconds since January 1st 1970, and it's a good way to check this sort of thing.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Wed Jan 21, 2009 9:50 am   
 
You can also use Options > General > Session > Scrollback (along the top), and check both "Show timestamps" and "Show delta time".
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed Jan 21, 2009 10:05 pm   
 
Wow thanks guys :) I setup a timer to add 1 to the counters every 60 seconds as I don't really care about how many seconds it has been :)

Now I have another question which hopefully you'll will be able to answer.

I'm looking for a way to change
Quote:

You count four troll left eyes, four human left eyes, four troll right eyes, four human right eyes, four cured human right eyes, six cured human left eyes, three cured crab right eyes, two cured bird left eyes, three cured crab left eyes and one cured bird right eye with a total of thirty-five items.


That word number to an actual number I can use in a gauge. Any ideas?
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Jan 21, 2009 10:35 pm   
 
There's a script in Finished ZMud Scripts section that does just that.
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Wed Jan 21, 2009 11:35 pm   
 
Mind linking to it? I spent sometime searching the forums and couldn't find it.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Jan 22, 2009 12:02 am   
 
Heh, it's on the first page...

http://forums.zuggsoft.com/forums/viewtopic.php?t=29522
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Fewyn
Wanderer


Joined: 27 Sep 2002
Posts: 83

PostPosted: Thu Jan 22, 2009 1:16 am   
 
I must have been completely blind then.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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