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
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Mon Feb 11, 2002 6:20 pm   

Mud Time - Timer?
 
Hi there!
i would like to set the Timer to the MUD-Time

if i type "time", the first line says:
It is 7am, on the Day of the Sun

in the towns, you hear clock towers, which looks like:

The clock tower chimes the hour of 9am.
The clock tower chimes the hour of 12 noon.

now i would like to set my timer to the mud time, because all shops have opening hours and some places are only accesible at certain times.


anybody who has got a script for that?
(i'd set my timer to 24 hours, allthought, the mud time is in am and pm, but i'd like to see the differents between night and day)

thx for your help
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Feb 11, 2002 9:16 pm   
 
When you say you want to set the timer to the mud-time, do you mean the tick timer? or do you mean just a regular alarm type timer?

If you are talking about the tick timer, then you'll first have to get a rough estimate of how long a mud-hour is, whether that's 120 seconds or 60 seconds or whatever. Then set your tick timer to this and start the tick timer. Once you've got that set up, then you'd have a couple triggers:

#trigger {The clock tower chimes the hour of (%d)({am|pm}).} {#ts;#var hour %1;#if (%2=pm) {#add hour 12}}

#trigger {The clock tower chimes the hour of 12 ({noon|midnight}).} {#ts;#if (%1=noon) {#var hour 12} {#var hour 00}}

Most muds that I've been to don't have an exact tick counter, it varys +/- a few seconds which is why I use #ts, to tweak the tick timer. Now, you say you only hear the clock towers when you're in town, so you won't always have those triggers going off. So, what you probably want to do open up the tick timer and in the 'Timeout Command' textbox, type 'checkhour' or whatever you want to call the alias that's below.

#alias checkhour {#add hour 1;#if (@hour=24) {#var hour 00}}

Update the Timeout Margin to 5-10 seconds, depending on your taste. The point is, you want the Timeout command to go off BEFORE the triggers. If you don't then you'll be off by an hour. Finally, to see what time it is, just create a status line displaying the hour:

#st {Time: @hour}

That way, you just have to glance at the status line to see what hour it is on the mud.

All this code is untested, just going by the online help files, you may have to tweak it a bit.

Iljhar
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