@@ Time and Weather Code @@ By Mike Griffiths (talvo@talvo.com) @@ Latest version available from www.talvo.com @@ Installation instructions (more detailed setup in 'ahelp time and weather': @@ Edit the @VA ME= line below to give the dbref of a command object in the master room. @@ It should have loud, can_nspemit, pemit_all, etc. @@ Set the &RATIO %VB= line as desired. Only tested with ratios >= 1 @@ You may also want to edit the timezone changes, make cosmetic changes to the +time command, etc @@ (check the help if you need more info). @@ Add any triggers desired. See help for more info. @@ Then add the commands at the very bottom of the file into #1's @startup. @@ You may want to @function some of the other public/vis attrs on the function object, or just @@ post the dbref in a helpfile and let people call them directly. @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ Command object '%va' already created @va me= @set me=VB:[create(Time and Weather Functions and DB)] @@ How many IC minutes to a RL minute? &RATIO %vb=2 @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ Don't touch anything below this line. @set %vb=!no_command @lock/use %vb=flag^wizard|flag^royalty|=%vb @@ fdiv(1,v(ratio)) @set %vb=RATIO_INTERNAL:[fdiv(1,get(%vb/ratio))] @@ Moon phase (returns 1-8). Args: %0 = year, %1 = month (1-12), %2 = day (0-31) &fun.moonphase %vb=setq(c,mul(%0,365.25))[setq(e,mul(%1,30.6))][setq(j,0.[after(fdiv(add(%qc,%2,%qe,-694039.09),29.53),.)])][bound(add(ceil(mul(%qj,8)),1),1,8)] &moonphases %vb=New Moon|Waxing Crescent|First Quarter|Waxing Gibbous|Full Moon|Waning Gibbous|Last Quarter|Waning Crescent &moonphase %vb=ufun(fun.moonphase,switch(%0,,v(year),%0),switch(%1,,v(month),%1),switch(%2,,v(dom),%2)) &year %vb=2007 &month %vb=6 &months %vb=January February March April May June July August September October November December &months_short %vb=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec &dom %vb=17 &weekday %vb=1 &weekdays %vb=Sunday Monday Tuesday Wednesday Thursday Friday Saturday &weekdays_short %vb=Sun Mon Tue Wed Thu Fri Sat &leapyear %vb=not(mod(v(year),4)) &season %vb=u(fun.season) &seasons %vb=Spring Summer Autumn Winter &season_name %vb=elements(v(seasons),u(season)) &cloudy %vb=t(member(cloudy storm fog rain snow lightsnow,v(weather`type))) &hour %vb=0 &hour_long %vb=00 &12hour %vb=switch(v(hour),>12,sub(#$,12),0,12,#$) &12hour_long %vb=rjust(u(12hour),2,0) &m %vb=switch(v(hour),>11,PM,AM) &minutes %vb=u(fun.minutes) &seconds %vb=u(fun.seconds) &time %vb=v(hour_long):[rjust(u(minutes),2,0)]:[rjust(u(seconds),2,0)] &date %vb=v(dom)/[v(month)]/[v(year)] &datetime %vb=u(time) [u(date)] &ord %vb=switch(%0,11,11th,12,12th,13,13th,*1,%0st,*2,%0nd,*3,%0rd,%0th) &datetime_english %vb=elements(v(weekdays),v(weekday)), [u(ord,v(dom))] [elements(v(months),v(month))], [v(year)] &datetime_timefunc %vb=elements(v(weekdays_short),v(weekday)) [elements(v(months_short),v(month))] [rjust(v(dom),2,0)] [u(time)] [v(year)] &timezone %vb=GMT &tod %vb=u(tod-2) &tod-2 %vb=switch(v(hour),<6,night,<20,day,night) &tod-4 %vb=switch(v(hour),<4,night,<7,dawn,<18,day,<21,dusk,night) &weatherobj %vb=if(orflags(%@,Wr),%!,#-1) &fun.ictimefunc %vb=switch(%+,0,sort(v(fun.ictimefunc`list)),if(hasflag(me/%0,public visual),ulocal(me/%0,%1,%2,%3,%4,%5,%6,%7,%8,%9),#-1) @@ List of attrs that can be called via ictimefunc() &fun.ictimefunc`list %vb=12hour 12hour_long ampm cloudy date datetime datetime_english datetime_timefunc dom hour hour_long leapyear minutes month months months_short moonphase moonphases ord ratio season season_name seasons seconds time timezone tod tod-2 tod-4 weatherobj weekday weekdays weekdays_short year @dolist get(%vb/fun.ictimefunc`list)=@set %vb/##=visual public &fun.minutes %vb=bound(div(round(mul(sub(secs(),default(tick`last,secs())),v(ratio)),0),60),0,59) &fun.seconds %vb=bound(mod(round(mul(sub(secs(),default(tick`last,secs())),v(ratio)),0),60),0,59) &fun.season %vb=switch(v(month),<2,4,3,switch(v(dom),<21,4,3),<6,1,6,switch(v(dom),<21,1,2),<9,2,9,switch(v(dom),<21,2,3),<12,3,12,switch(v(dom),<21,3,4),-1) &days_in_month`1 %vb=31 &days_in_month`2 %vb=if(u(leapyear),29,28) &days_in_month`3 %vb=31 &days_in_month`4 %vb=30 &days_in_month`5 %vb=31 &days_in_month`6 %vb=30 &days_in_month`7 %vb=31 &days_in_month`8 %vb=31 &days_in_month`9 %vb=30 &days_in_month`10 %vb=31 &days_in_month`11 %vb=30 &days_in_month`12 %vb=31 @set %vb/days_in_month**=vis @@ This is like bound(), except if it's lower than %1 OR higher than %2, we still default to %1, never %2. &fun.bound-reset %vb=switch(%0,<%1,%1,>%2,%1,%0) @@ The ICTIMEFMT() function. Codes timefmt() has that we don't: U W &fun.ictimefmt`list %vb=a A b B c d H I j m M p P S w x X Y Z $ &fun.ictimefmt %vb=localize(setq(0,,2,v(fun.ictimefmt`list))[setq(1,regeditall(%0,\\$(.),if(member(%q2,$1),ulocal(me/fun.ictimefmt`$1,$1),setq(0,%q0 $1))))][switch(squish(%q0),,%q1,#-1 INVALID ESCAPE CODE '[first(%q0)]')]) &fun.ictimefmt`a %vb=elements(v(case(%0,a,weekdays_short,weekdays)),v(weekday)) &fun.ictimefmt`b %vb=elements(v(case(%0,b,months_short,months)),v(month)) &fun.ictimefmt`c %vb=elements(v(weekdays_short),v(weekday)) [rjust(v(dom),2,0)] [elements(v(months_short),v(month))] [v(year)] [ufun(12hour_long)]:[rjust(u(fun.minutes),2,0)]:[rjust(u(fun.seconds),2,0)] [ufun(ampm)] [v(timezone)] &fun.ictimefmt`d %vb=rjust(v(dom),2,0) &fun.ictimefmt`h %vb=v(hour_long) &fun.ictimefmt`i %vb=u(12hour_long) &fun.ictimefmt`j %vb=lmath(add,iter(lnum(0,sub(v(month),1)),udefault(me/days_in_month`##,)) [v(dom)]) &fun.ictimefmt`m %vb=case(%0,m,rjust(v(month),2,0),rjust(u(fun.minutes),2,0)) &fun.ictimefmt`p %vb=ufun(ampm) &fun.ictimefmt`s %vb=rjust(u(fun.seconds),2,0) &fun.ictimefmt`w %vb=sub(v(weekday),1) &fun.ictimefmt`x %vb=case(%0,x,rjust(v(month),2,0)/[rjust(v(dom),2,0)]/[v(year)],v(hour_long):[rjust(u(fun.minutes),2,0)]:[rjust(u(fun.seconds),2,0)] [ufun(ampm)]) &fun.ictimefmt`y %vb=right(v(year),case(%0,y,2,4)) &fun.ictimefmt`z %vb=v(timezone) &fun.ictimefmt`$ %vb=$ @@ Triggered every IC hour &tick %vb=@wait mul(3600,v(ratio_internal))=@trigger me/tick ; think u(tick`tock) ; @trigger me/tick`hour=[v(hour)] ; @assert eq(0,v(hour)) ; @trigger me/tick`day=[v(dom)] ; @assert eq(1,v(dom)) ; @trigger me/tick`month=[v(month)] ; @assert eq(1,v(month)) ; @trigger me/tick`year=[v(year)] &tick`tock %vb=set(me,tick`last:[secs()])[set(me,hour:[ufun(fun.bound-reset,inc(v(hour)),0,23)])][ufun(tick`tock_tz)][set(me,hour_long:[rjust(v(hour),2,0)])][switchall(011,v(hour)11,set(me,dom:[ufun(fun.bound-reset,inc(v(dom)),1,u(days_in_month`[v(month)]))])[set(me,weekday:[ufun(fun.bound-reset,inc(v(weekday)),1,7)])],v(hour)[v(dom)]1,set(me,month:[ufun(fun.bound-reset,inc(v(month)),1,12)]),v(hour)[v(dom)][v(month)],set(me,year:[inc(v(year))]))] @@ Check we aren't changing timezone. Default code handles GMT and BST (Greenwich Mean Time and British Summer Time, ie, @@ UK timezone changes). We do GMT->BST (+1hour) at 1am GMT on the last Sunday of March. And we go back (BST->GMT, -1hour) @@ at 2am BST on the last Sunday of October &tick`tock_tz %vb=switch(v(hour)/[v(weekday)]/[v(month)]/[v(timezone)],1/7/3/GMT,if(gt(v(dom),24),set(me,hour:2)[set(me,timezone:BST)]),2/7/10/BST,if(gt(v(dom),24),set(me,hour:1)[set(me,timezone:GMT)])) @@ %vb/tick`hour is triggered every IC hour @@ %vb/tick`day is triggered at midnight (ie, when the IC day changes) @@ %vb/tick`month is triggered at midnight on the 1st (ie, when the IC month changes) @@ %vb/tick`year is triggered at midnight on Jan 1st (ie, when the IC year changes) @startup %vb=@trigger me/tick @@ &tick`hour %vb=@wall It's %0 o'clock! @@ &tick`day %vb=@wall It's the [ufun(ord,%0)] of the month! @@ &tick`month %vb=@wall It's the [ufun(ord,%0)] month! &tick`day %vb=@@ Trigger the weather object ; @switch gte(v(weather`change-day),first(shuffle(2 2 3 3 3 3 3 3 4 4 4 5)))=1,setweather auto,&weather`change-day me=[add(v(weather`change-day),1)] &cmd.time %va=$+time: @nspemit/silent %#=center(%b+TIME%b,78,=)[switch(timefmt($Z),GMT,,UTC,,%rRL Time ([timefmt($Z)]) is: [time()])]%rRL Time (GMT) is: [utctime()]%r[repeat(-,78)]%rIC Time ([get(CLOCKCODE/timezone)]) is: [ufun(CLOCKCODE/datetime_timefunc)]%rIC Weather: [u(CLOCKCODE/weather)] ([u(CLOCKCODE/weather,1)])%rThe Moon Is A: [elements(get(CLOCKCODE/moonphases),u(CLOCKCODE/moonphase),|)]%r[repeat(=,78)] @force me=@edit %va/cmd.time=CLOCKCODE,%vb @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &weather %vb=if(%0,v(weather`type),u(weather`desc)) &cmd.setweather %vb=$setweather */*: @pemit/silent %#=switch(0,strlen(setr(0,grab(|[v(weather`types)],%0*,|))),Invalid Weather Type. Must be one of: [itemize(v(weather`types),|,or)],match(u(weather`typesfor,setr(1,u(season_name))),%q0),We can't have %q0 in %q1! Must be one of: [u(weather`typesfor,%q1)],strlen(squish(%1)),attrib_set(%!/weather`change-season,u(season_name))[attrib_set(%!/weather`type,%q0)][attrib_set(%!/weather`change-day,-3)][attrib_set(%!/weather`desc,first(shuffle(v(weather`[v(weather`change-season)]`%q0),|),|))][u(weather`predict,v(weather`change-season),v(weather`type))]New Weather Type: %q0%rNo Weather Description Specified. Using Standard: [u(weather`desc)],New Weather Type: %q0%rNew Weather Description: %1[attrib_set(%!/weather`change-season,u(season_name))][attrib_set(%!/weather`type,%q0)][attrib_set(%!/weather`change-day,-3)][attrib_set(%!/weather`desc,%1)]) &cmd.setweather-auto %vb=$setweather auto: @pemit/silent %#=attrib_set(%!/weather`change-season,u(season_name))[attrib_set(%!/weather`type,first(shuffle(v(weather`type`[v(weather`change-season)]`[v(weather`type)])) fair))][attrib_set(%!/weather`change-day,0)][attrib_set(%!/weather`desc,first(shuffle(v(weather`[v(weather`change-season)]`[v(weather`type)]),|),|))][u(weather`predict,v(weather`change-season),v(weather`type))]%rNew Weather Type: [v(weather`type)]%rNew Weather Descriptions: [u(weather`desc)] &cmd.stats %vb=$weatherstats *: @pemit/silent %#=switch(0,strlen(setr(0,grab(|Spring|Summer|Autumn|Winter,%0*,|))),Correct Syntax is STATS \, where is one of Spring\, Summer\, Autumn or Winter.,center(%b[ansi(h,%q0 Weather)]%b,78,=)%r[iter(lattr(%!/weather`type`%q0`*),ljust(last(%i0,`),11): [setq(1,v(%i0))][setq(2,words(%q1))][iter(sortkey(#lambda/words(matchall(%%q1\,%%0)),setunion(%q1,)),%i0 [round(mul(fdiv(words(matchall(%q1,%i0)),%q2),100),0)]%%,,\,%b)],,%r)]%r[repeat(=,78)]) &weather`predict %vb=attrib_set(%!/weather`prediction,first(shuffle(udefault(%!/weather`predict`%1->[first(shuffle(v(weather`type`%0`%1)) fair)],udefault(%!/weather`predict`%1->,u(weather`predict`default))),|),|)) &weather`predict`DEFAULT %vb=The day should turn mild, with north-easterly winds.|It will be cool but dry, with strong winds from the [first(shuffle(north south east west north-east north-east south-west south-east))].|Expect light showers, with some occasional sunny spells. &weather`predict`FAIR-> %vb=The weather is likely to worsen slightly over the next few days.|The clear, fair weather is slowly coming to an end. &weather`predict`FAIR->CLOUDY %vb=Clouds will move in from the [first(shuffle(north north north south west west east))], but it should remain dry.|The temperatures should be pleasant, despite a few clouds appearing in the sky.|It will cloud over soon, with a slight chance of rain. &weather`predict`FAIR->FAIR %vb=The weather should continue to be bright and clear.|Temperatures will take a dive, but it will remain clear and bright.|The sun will continue to shine pleasantly.|Occasional showers can be expected soon. &weather`predict`FAIR->RAIN %vb=Rain clouds will sweep in in the next couple of days.|Be prepared for some light showers; rain clouds are on the way.|It should stay dry and mostly clear, with occasional patches of cloud. &weather`predict`FOG->FAIR %vb=The fog will clear soon, and the day should be clear and bright. &weather`predict`FOG->RAIN %vb=Expect rain once the fog clears.|Rain is expected after the fog has cleared. &weather`predict`LIGHTSNOW->LIGHTSNOW %vb=The snow is expected to continue, though temperatures shouldn't be too low.|The snow will be replaced with light showers before it eventually clears. &weather`predict`LIGHTSNOW->SNOW %vb=The snow will likely worsen over the next couple of days as temperatures take a dive. &weather`predict`RAIN->FAIR %vb=South-easterly winds should clear the rainclouds away over the next two or three days.|The rain should lessen tomorrow, with it halting all together by the end of the week. &weather`predict`RAIN->LIGHTSNOW %vb=The rain will continue, with a possibility of some snow. &weather`predict`RAIN->RAIN %vb=The rain will likely continue, on and off, for several days to come.|More light showers are expected for the rest of the week. &weather`predict`RAIN->STORM %vb=The weather is set to worsen, with full-on storms expected soon.|The rain will become more fierce, with a possibility of strong winds and hail. &weather`predict`SNOW-> %vb=The snow should begin to ease off tomorrow.|Temperatures should rise within the next few days, removing all traces of snow. &weather`predict`SNOW->SNOW %vb=More snow will fall over the next few days.|Be ready for snow-hobbits to pop up in the North-Farthing; more snow is expected. &weather`predict`STORM-> %vb=The storms should lessen tomorrow, and be gone within the next three days.|Expect the storms to ease off slowly, and the sun to shine by the end of the week. &weather`predict`STORM->STORM %vb=The storms are expected to contiue, making travel hazardous.|The storms are expected to worsen, with gail-force winds expected from the [first(shuffle(north north south south south west west west west east east))]. &weather`types %vb=fair|cloudy|storm|rain|lightsnow|snow|fog &weather`typesfor %vb=switch(grab(spring summer autumn winter,%0*),,#-1 INVALID SEASON,setunion(iter(lattr(me/weather`type`#$`*),v(%i0)),)) &weather`change-day %vb=999 &weather`type`autumn`CLOUDY %vb=fair fair fair fair fair cloudy cloudy cloudy cloudy cloudy cloudy cloudy fog fog fog rain rain rain rain rain rain storm storm &weather`type`autumn`FAIR %vb=fair fair fair fair fair fair fair cloudy cloudy cloudy cloudy rain fog &weather`type`autumn`FOG %vb=fair fair fair fair fair fair fair cloudy cloudy rain rain rain rain rain &weather`type`autumn`RAIN %vb=storm storm rain rain rain rain rain rain rain cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy fair fair &weather`type`autumn`STORM %vb=storm storm rain rain rain rain rain cloudy cloudy cloudy cloudy cloudy cloudy cloudy fair fair &weather`type`spring`CLOUDY %vb=fair fair fair cloudy cloudy cloudy cloudy cloudy rain rain rain fog fog storm &weather`type`spring`FAIR %vb=fair fair fair fair fair cloudy cloudy cloudy cloudy cloudy fog fog rain &weather`type`spring`FOG %vb=cloudy cloudy fair fair fair rain rain fog fog &weather`type`spring`LIGHTSNOW %vb=rain rain rain rain rain cloudy cloudy cloudy cloudy fog &weather`type`spring`RAIN %vb=rain rain rain rain rain storm storm storm storm cloudy cloudy cloudy cloudy cloudy cloudy fair fair fair fair fog &weather`type`spring`SNOW %vb=rain rain rain rain rain rain cloudy cloudy cloudy &weather`type`spring`STORM %vb=storm storm rain rain rain rain cloudy cloudy cloudy cloudy fog fog &weather`type`summer`CLOUDY %vb=fair fair fair cloudy cloudy cloudy cloudy cloudy cloudy cloudy rain rain rain &weather`type`summer`FAIR %vb=fair fair fair fair fair fair fair fair fair cloudy cloudy cloudy cloudy rain &weather`type`summer`FOG %vb=cloudy fair fair fair fair fair fair fair fair rain &weather`type`summer`RAIN %vb=fair fair fair fair fair cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy rain rain rain rain rain rain rain storm &weather`type`summer`STORM %vb=storm storm rain rain rain rain rain rain rain rain rain cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy cloudy fair fair fair fair fair &weather`type`winter`CLOUDY %vb=cloudy cloudy cloudy cloudy cloudy fair fair fair fair rain rain rain rain lightsnow lightsnow storm &weather`type`winter`FAIR %vb=fair fair fair fair fair fair cloudy cloudy cloudy cloudy cloudy cloudy cloudy rain rain lightsnow &weather`type`winter`FOG %vb=fair fair fair fair fair cloudy cloudy cloudy cloudy cloudy &weather`type`winter`LIGHTSNOW %vb=lightsnow lightsnow lightsnow lightsnow snow snow rain cloudy cloudy cloudy cloudy fair fair fair fair fair &weather`type`winter`RAIN %vb=rain rain rain rain rain rain rain rain lightsnow lightsnow lightsnow lightsnow cloudy cloudy cloudy cloudy cloudy cloudy fair fair fair fair storm storm &weather`type`winter`SNOW %vb=snow snow snow lightsnow lightsnow rain rain cloudy cloudy cloudy cloudy &weather`type`winter`STORM %vb=storm storm storm rain rain rain rain rain rain rain rain cloudy cloudy cloudy cloudy cloudy cloudy fair snow &weather`autumn`CLOUDY %vb=Dark grey clouds fill the sky, blocking out the light of [switch(u(tod),day,the sun,stars and moon alike)]. Although no rain has yet fallen, with little wind to move the clouds it seems a distinct possibility.|Heavy clouds spread ominiously across the dark sky, warning of rain to come.|A few light rainclouds are dotted about the sky, though no rain falls from them. A light south-easterly wind stirs them occasionally across the [switch(u(tod),day,pale-blue blanket of sky,pitch-black night sky\, colored only by a few pinpricks of starlight)]. &weather`autumn`FAIR %vb=The sky is clear, the [switch(u(tod),day,sun shining,stars twinkling)] brightly. The air is warm; a trace of summer lingers still this autumn.|A gentle wind blows from the north-east, moving the small scattering of clouds about the otherwise clear sky. The air is fairly cold, and a little damp; rain may be on the way soon.|Not a single cloud can be seen on the horizon. The [u(tod)] is clear, and fairly warm away from the wind which, blowing moderately from the north-west, is enough to chill the air. &weather`autumn`FOG %vb=The world is veiled in a thick, choking fog. The air is cold and damp, most unpleasant to be out in. The dark fog is stirred softly by a westerly wind.|Cold mist hides everything from view to[u(tod)]. The ground feels damp, and the air is chilly.|The world is hidden by a veil of mist and fog. Little light penetrates the sky, suggesting a fairly heavy cloud cover above.|There is no wind to stir the heavy fog which seems to be everywhere to[u(tod)]. The pale light of the [switch(u(tod),day,sun,stars)] can dimly be sensed from above. &weather`autumn`RAIN %vb=A light trickle of rain washes down from the sky, refreshing the air. Refreshing or not, though, few people venture out without an umbrella.|Rain falls heavily from grey-black clouds filling the sky, and is driven forward by a strong westerly wind.|The gentle sound of rain dropping from the sky accompanies a light shower from grey-white clouds, which fill most of the [switch(u(tod),night,night%b)]sky. A light wind blows from the north-east.|Cold rain falls from the sky, soaking any who venture outside quickly. Along with the strong southern winds, the rain chills to the very core.|Puddles of cold water are dotted all around, and every few minutes another light shower adds to the water soaking the world. &weather`autumn`STORM %vb=Dark, menacing clouds fill the sky, pouring a heavy onslaught of rain down upon the ground, relentless in its drenching. Strong winds blow from the north, lashing the sheets of rain down heavily through all items of clothing.|Rain buckets from the sky, accompanied by the occasional hail-stone, and all are slanted by the heavy winds which howl from the northwest.|The occasional flash of lightening is all that lights the sky to[u(tod)]; the heavy black rainclouds block any trace of [switch(u(tod),day,sun,moonlight or star)]light. The sound of rain beats against the ground unendingly. &weather`spring`CLOUDY %vb=The wind sends fluffy white clouds tumbling across the sky as warm breezes sigh gently through new buds that paint the trees with a green tint.|Grey clouds dot the sky, suspended motionless in the absence of wind. The mild temperature heralds the arrival of Spring.|Clouds gather and darken, bringing the threat of rain, although the temperature remains warm and pleasant. &weather`spring`FAIR %vb=The temperature is mild, even warm, and a cloudless sky spans the horizon.|The winds are still and the sky cloudless, as the world warms with the arrival of Spring.|Soft rustlings can be heard in every glen and dale, as small creatures begin to stir. Soft winds bring mild temperatures, and the sky above is clear of clouds. &weather`spring`FOG %vb=A damp fog blankets the world, rolling over the hills and into the valleys in a clinging wave. The temperature is mild as the Spring rolls in once more.|The world is shrouded in a light fog, tendrils creeping up from the ground as if to wrap around the warming air itself.|Warm is the air, but thick is the fog, casting a wrap over the world, muffling and distorting sound and making it hard to see your hand in front of your face. &weather`spring`RAIN %vb=The temperatures warm with the coming of Spring, and light rain showers down, coaxing the many plants back to life.|A slight chill is in the air, the last remnants of Winter, but Spring showers fall lightly and bring life back to the sleeping flora.|Gentle rains fall steadily on the ground, pattering down as a warm wind sweeps through with the scents of Spring. &weather`spring`STORM %vb=Lightning brightens the sky, punctuated by the crackle of lightening, as rain falls heavily upon the ground.|Despite the warm temperatures that have returned with Spring, a heavy rain falls, turning the world into a large puddle.|Few dare to venture forth as heavy Spring rain falls, cascading from the sky in sheets and chilling the air. &weather`summer`CLOUDY %vb=Fluffy white clouds are dotted about the sky, dimming the light of the [switch(u(tod),day,sun,stars)]. The air is reasonably warm, despite occasional winds blowing from the north.|The sky is filled with white clouds; rain could well be on the way. The air is cool for the time of year, and the northwesterly winds do little to help.|Clouds are dotted about the sky, keeping the heat in and making the air stiflingly hot. The only respite comes from a cool, gentle breeze blowing lightly from the southeast. &weather`summer`FAIR %vb=The sky is clear, and the [switch(u(tod),day,Sun,starlight)] shines brightly down upon the world. The [u(tod)] is warm, a gentle breeze stirring the air.|Not a single cloud can be seen in the sky, where [switch(u(tod),day,the sun shines brightly,a thousand stars twinkle merrily)]. The air is cool for the time of year, but warm enough for cloaks to be disgarded.|A beautiful summer's [u(tod)]; it is pleasantly warm, and under the bright light of the [switch(u(tod),day,sun,stars)] there's nothing more you could wish for. &weather`summer`RAIN %vb=Droplets of rain fall gently from the sky, the soft pitter-patter of the water on the ground barely audible.[switch(u(tod),day,{%bThe sun shines brightly, despite the rain, and the traces of a rainbow can be seen.})]|Rain falls gently from pale-grey clouds which fill the [switch(u(tod),night,night%b)]sky. A few puddles have formed in places, though the rain is barely enough to water the grass.|A day for umbrellas and cloaks, without a doubt. Summer seems to have ended early; the air is cold, and rain falls continuously from dark clouds.|Raindrops fall from fluffy white clouds high in the sky. The air is warm, although a cold breeze blows from the west. &weather`summer`STORM %vb=The summer storms are raging; heavy rain pours relentlessly from the sky, and the occasional rumble of thunder can be heard.|The heavens have opened, and the ground is soaked by an unending downpour. Flashes of lightning split the sky in two, and the echoing sound of thunder is all that can be heard over the banging of heavy rain-drops.|Wet. The on-going downpour soaks the ground, and all who venture out from the snugness of a warm, dry home. The air is cold, and winds blow heavily from the east. &weather`winter`CLOUDY %vb=The sky is full of fluffy white clouds, and the [u(tod)] is rather pleasant; moderately warm, for the time of year, heavy winter cloaks can generally be discarded to[u(tod)].|Clouds fill the sky, making the temperature even lower than average. The sky is dark, the clouds holding a silent threat of rain to come.|Ominous grey clouds block the [switch(u(tod),day,blue,night)] sky, threatening possible storms to come. The temperature, however, is rather pleasant, as long as you avoid the chill breezes which blow from the east.|A cold wind blows from the south, though it's not enough to move the heavy covering of clouds which fills the sky away. The air is cold and moist, and snow seems more than possible. &weather`winter`FAIR %vb=The skies are clear; [switch(u(tod),day,a sea of crisp\, pale blue\, with not a single cloud in sight,stars twinkle brightly against the black veil of the night)]. The air is pleasantly warm for the time of year.|A few fluffy white clouds are dotted around the sky, though the [switch(u(tod),day,sun,star)]light is mostly unobscured as it shines down. The [u(tod)] is suprisingly warm, although it would be more pleasant without the gentle breeze which cools the air somewhat.|The [u(tod-4)] is mild, the [switch(u(tod),day,dazzling sun,twinkling stars)] shining brightly. A gentle northeasterly breeze cools the [u(tod)] air, and stirs the few clouds which float slowly across the sky. &weather`winter`LIGHTSNOW %vb=Tiny snowflakes, a crisp-white, drop delicately down from the sky. So far no snow has managed to settle; instead, it melts almost instantly as it touches the ground. The winds are cold but infrequent, and the air is otherwise rather pleasant, despite the gentle snowfall.|A gentle cascade of snowflakes drops delicately from the sky. The snowfall is fairly light, however[switch(u(tod),day,; not enough to block out the weak sun)]. The ground is clear, with only a few wet patches showing any sign of the gentle snowing. &weather`winter`RAIN %vb=The rain falls gently from the sky, the gentle pitter-patter of the drops scarcely audible. [switch(u(tod),day,The sun is already shining\, albeit dimly\, and the clouds appear to be dispersing.,The stars are beginning to peak through the clouds\, now\, a sign that the rain is perhaps coming to a halt.)]|Sodden and damp; rain thunders down from the heavens, soaking everyone that ventures out of shelter. Dark clouds fill the sky, and show no signs of relenting.|Raindrops fall heavily from thick clouds which fill the [switch(u(tod),night,night)] sky. [switch(u(tod),day,The sun occasionally shines through a gap in the clouds\, though the weather shows no signs of letting up.,Only the faintest glimmer of starlight can penetrate the cloud cover.)]|Water, water, everywhere. Clouds fill the sky, pouring an endless assault of water down upon the world. The sun has managed to get a decent amount of warmth through, the the chill winds negate most of its comforts. &weather`winter`SNOW %vb=A thin layer of crisp snow covers the ground, the white blanket disturbed only where people have walked, or children have made snowballs. The air is chill, even more so in the gentle breeze, and anyone with any sense is wrapped in a blanket by the fire.|The world is white to[u(tod)]. The snow still falls gently, and a thin layer of it blankets all, although the air is slowly beginning to warm.|Snow rests in most places on the ground, masking treacherous patches of slippery ice. Breath mists in the air wherever people walk, and the few who venture out do so with scalves and thick cloaks.|Like a scene from a Christmas card; a thin blanket of snow rests gently on the ground, though no snow drops at present. The air is crisp, enough to make most people stay beside a warm fire with a hot drink. &weather`winter`STORM %vb=The sky is filled with thick, black clouds. Hailstones, ranging from the size of pebbles to golfballs fall intermittently from among lasting rain. [switch(u(tod),day,Barely any sunlight penetrates the clouds\, and the day is dim and cold.,No trace of starlight pierces the clouds; the only light comes from occasional flashes of lightening which split the skies in two.)]|Rolling thunder echoes, ominous of the lighting which follows soon after. Rain buckets down, unceremoniously soaking any who venture outside.|Heavy black clouds fill the sky, as far as the eye can see, each unburdening itself of gallons of rain. The occasional flash of fork lighting illuminates the dark skyline. &taw`version %vb=1.1 @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ Stuff to go in #1's @STARTUP (change %VA for the dbref of the command object, and @@ %VB for the dbref of the function/db object, or set the attributes on #1 @@ @command/add +TIME @@ @hook/override +TIME=%va,cmd.time @@ @function/preserve ictimefmt=%vb,fun.ictimefmt,1,1 @@ @function weather=%vb,weather,0,1 @@ @function/preserve ictimefunc=%vb,fun.ictimefunc,0,9