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
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Sat Oct 23, 2004 4:50 am   

uptime clock in T2T Mud
 
Ok, I did some research, and I came up with this so far for my uptime clock.

#ALARM {*2} {#ADD seconds 1;#IF (@seconds >= 60) {#ADD minutes 1;#VAR seconds 0};#IF (@minutes >= 60) {#ADD hours 1;#VAR minutes 0};#IF (@hours >= 24) {#ADD days 1;#VAR hours 0}}


#VAR seconds {33} {0}
#VAR minutes {3} {0}
#VAR hours {0} {0}
#VAR days {0} {0}

Here is the question, I am having problems getting it to set up and initalize. I want to do it when ever I see this line from the mud.

The Two Towers has been up for 6h 41m 49s.

Here is the problem:
When the time gets to somewhere in days, it becomes this.

The Two Towers has been up for 2d 6h 41m 49s.

I need a trigger that will pull the data from either set of data. Or would two triggers run faster?

Thanks for the help.
Yamabushi
_________________
Yama
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Oct 23, 2004 4:15 pm   
 
*Flex* Even though I am sure there is a way to do it with a regex trigger pattern I didn't feel like looking it up :P

#TR {The Two Towers has been up for (*).} {
#IF %regex( "%1", "(\d+)d") {#CALL %regex("%1","(\d+)d",days)} {days=0}
#IF %regex( "%1", "(\d+)h") {#CALL %regex("%1","(\d+)h",hours)} {hours=0}
#IF %regex( "%1", "(\d+)m") {#CALL %regex("%1","(\d+)m",mins)} {mins=0}
#IF %regex( "%1", "(\d+)s") {#CALL %regex("%1","(\d+)s",secs)} {secs=0}
}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Sat Oct 23, 2004 6:54 pm   
 
Ok, looks like it'll work. I'll know in about 4-8 hrs when the boot gets up into the days.

Thanks
_________________
Yama
Reply with quote
ttsang
Newbie


Joined: 17 Oct 2004
Posts: 4
Location: Canada

PostPosted: Fri Oct 29, 2004 2:51 pm   
 
I would like to have this :
#alias reset {
jobTime.1=%time( hh)
jobTime.2=%time( nn)
}

#alias time {#say %int(%int(%int(%time(hh))-%int(@jobTime.1))*60 + %int(%time(nn)) - %int(@jobTime.2)) min}
this is base on "minutes"
_________________
Timothy C. Tsang
Specialization in Actuarial Science
The University of Western Ontario
London, Ontario, Canada
ttsang5@uwo.ca
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