07 Oct, 2009, Valo wrote in the 1st comment:
Votes: 0
I'm trying to adjust the time that is displayed ahead by an hour on Keran's Weather System for MUX, but I can't seem to figure it out. If anyone could help me out, that'd be great.
07 Oct, 2009, Igabod wrote in the 2nd comment:
Votes: 0
is it going off of system time? Post the code in question so we don't have to hunt it down. Namely the portion that displays the time to the player.
07 Oct, 2009, Valo wrote in the 3rd comment:
Votes: 0
Pretty much what I'm trying to do is get it to say the time to say Wed Oct 07 05:43:11 instead of Wed Oct 07 04:43:11. The code for the string is

[squish([mid(time(), 0, 20)][/code]

I'm just learning to use Keran's system and it's a lot to go over. The full code can be found at http://www.hatrack.net/gwen/mushcode/ker...

The code for the clock section of the code is as follows.

[code]@create Keran's Clock=10
@lock Keran's Clock=#0
@Startup Keran's Clock=@trigger me/loop
&LOOP Keran's Clock=@trigger me/routine-time-of-day; @trigger me/routine-hour; @trigger me/routine-halfhour; @trigger me/routine-quarterhour; @trigger me/routine-tide; @trigger me/routine-moon; @trigger me/routine-sun; @wait 60 = @trigger me/loop
&DAY-NIGHT-DAWN-DUSK Keran's Clock=night
&LAST-DAY-NIGHT-DAWN-DUSK Keran's Clock=night
&ROUTINE-TIME-OF-DAY Keran's Clock=&last-time-of-day me = [u(time-of-day)]; &time-of-day me = [u(#149/time-of-day)]; @switch [comp(u(last-time-of-day), u(time-of-day))] = 0, @@, @dolist [v(triggerlist-time~of~day)] = @trigger ##/trigger-at-[u(#162/blank2tilde, u(#149/time-of-day))]
&ROUTINE-HOUR Keran's Clock=&last-hour me = [u(hour)]; &hour me = [u(#149/hour)]; @switch [comp(u(hour), u(last-hour))] = 0, @@, {@dolist [v(triggerlist-hour)] = @trigger ##/trigger-at-[u(#149/hour)]; @dolist [v(triggerlist-every~hour)] = @trigger ##/trigger-at-every~hour}
&ROUTINE-TIDE Keran's Clock=&last-tide me = [u(tide)]; &tide me = [u(#164/tide)]; @switch [comp(u(tide), u(last-tide))] = 0, @@, @dolist [v(triggerlist-tide)] = @trigger ##/trigger-at-[u(#162/blank2tilde, u(#164/tide))]
&ROUTINE-MOON Keran's Clock=&last-moon-up me = [u(moon-up)]; &moon-up me = [u(#164/moon-up)]; @switch [comp(u(moon-up),
u(last-moon-up))] = 0, @@, 1, @dolist [v(triggerlist-moon)] = @trigger ##/trigger-at-moonrise, -1, @dolist [v(triggerlist-moon)] = @trigger
##/trigger-at-moonset; &last-meridian-transit me = [u(meridian-transit)]; &meridian-transit me = [gt(secs(), u(#164/meridian-transit))];
@switch [comp(u(meridian-transit), u(last-meridian-transit))] = 0, @@, 1, @dolist [v(triggerlist-moon)] = @trigger ##/trigger-at-meridian~transit
&ROUTINE-SUN Keran's Clock=&last-day-night me = [u(day-night)]; &day-night me = [u(#149/day-night)]; @switch [comp(u(day-night), u(last-day-night))] = 0, @@, -1, @dolist [v(triggerlist-sun)] = @trigger ##/trigger-at-sunrise, 1, @dolist [v(triggerlist-sun)] = @trigger ##/trigger-at-sunset
&HOUR Keran's Clock=18
&LAST-HOUR Keran's Clock=18
&ADD-TO-TRIGGERLIST Keran's Clock=$add * *: &triggerlist-%1 me = [setunion(%0, v(triggerlist-%1))]
&DELETE-FROM-TRIGGERLIST Keran's Clock=$del * *: &triggerlist-%1 me = [setdiff(v(triggerlist-%1), %0)]
&IS-ADMIN Keran's Clock=[orflags(%#, WZ)]
@lock/UseLock Keran's Clock=IS-ADMIN/1
&TRIGGERLIST-TIME~OF~DAY Keran's Clock=#153 #157 #624
&VERSION Keran's Clock=4.0
&AUTHOR Keran's Clock=Keran@Keranset Island
&TRIGGERLIST-SUN Keran's Clock=#157 #624
&TRIGGERLIST-MOON Keran's Clock=#157 #624
&TRIGGERLIST-TIDE Keran's Clock=#157 #624
&TIME-OF-DAY Keran's Clock=dusk
&DAY-NIGHT Keran's Clock=night
&LAST-TIME-OF-DAY Keran's Clock=dusk
&LAST-DAY-NIGHT Keran's Clock=day
&MOON-UP Keran's Clock=1
&LAST-MOON-UP Keran's Clock=1
&MERIDIAN-TRANSIT Keran's Clock=1
&LAST-MERIDIAN-TRANSIT Keran's Clock=1
&ROUTINE-HALFHOUR Keran's Clock=&last-halfhour me = [u(halfhour)]; &halfhour me = [u(#149/halfhour)]; @switch [comp(u(halfhour), u(last-halfhour))] = 0, @@, @dolist [v(triggerlist-every~halfhour)] = @trigger ##/trigger-at-every~halfhour
&ROUTINE-QUARTERHOUR Keran's Clock=&last-quarterhour me = [u(quarterhour)]; &quarterhour me = [u(#149/quarterhour)]; @switch [comp(u(quarterhour), u(last-quarterhour))] = 0, @@, @dolist [v(triggerlist-every~quarterhour)] = @trigger ##/trigger-at-every~quarterhour
&HALFHOUR Keran's Clock=37
&LAST-HALFHOUR Keran's Clock=37
&QUARTERHOUR Keran's Clock=76
&LAST-QUARTERHOUR Keran's Clock=75
&TRIGGERLIST-HOUR Keran's Clock=#157 #624
&TIDE Keran's Clock=high and ebbing
&LAST-TIDE Keran's Clock=high and ebbing
&TRIGGERLIST-EVERY~HALFHOUR Keran's Clock=#624
&TRIGGERLIST-EVERY~QUARTERHOUR Keran's Clock=#624
&TRIGGERLIST-EVERY~HOUR Keran's Clock=#624
@set Keran's Clock=INHERIT
@set Keran's Clock=SAFE
@set Keran's Clock=VISUAL[/code]
07 Oct, 2009, Sandi wrote in the 4th comment:
Votes: 0
Well, the first thing to try is:

Well, the first thing to try is:

[squish([mid(time(local), 0, 20)]

If your server isn't handling daylight savings properly, then things get more complicated. You'll have to use something like:

[squish([mid(convsecs(secs(local) + 3600), 0, 20)]

And then you'll have to change it twice a year. :(




Note that it's best not to use the 'Code' tags when posting raw mushcode.
Those tags were meant for formatted stuff.
08 Oct, 2009, Valo wrote in the 5th comment:
Votes: 0
Sorry about the code format. I'll be sure not to use it again.

The first suggestion didn't seem to change the time at all and the second command set the clock to Wed Dec 31 18:00:00 and froze it. I'm still trying to figure out myself what's going on, but any other suggestions would be great.
0.0/5