Fixes for Keran's Weather System

Bug fixes for Keran's Weather System. No documentation, use at own risk.

Author: Due Rewards
Category: Weather Systems
Features: color substitutions.
Compatibility: TinyMUX.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Fixes for Keran's Weather System

Logfile from Due Rewards - Staff
@create Weather Parent=10
&APR Weather Parent=60
&AUG Weather Parent=88
&AVG_TEMP Weather Parent=sub(v(TEMPF_HI),div(sub(v(TEMPF_HI),v(TEMPF_LO)),2))
&BIAS Weather Parent=sub(rand(100),50)
&BREEZY Weather Parent=add(5,u(RAND_WIND))
&CALM Weather Parent=fdiv(rand(50),10)
&DAWN Weather Parent=switch(get(%vw/sky),overcast,1,cloudy,1,2)
&DAY Weather Parent=extract(u(#1928/vtime),3,1)
&DAY_PRECIP Weather Parent=43
&DBIASRAIN Weather Parent=switch(div(add(%0,50),20),0,none,1,unlikely,2,possible,3,probable,4,def inite)
&DBIAS_CLOUD Weather Parent=switch(div(add(%0,50),20),0,clear,1,some_clouds,2,clouds,3,cloudy,4,overcast)
&DEC Weather Parent=32
&DGROUND Weather Parent=switch(get(%vw/PRECIP),snow,snowy,rain,wet,hail,wet,sleet,wet,fr_rain,i cy,u(GROUND_STATUS))
&DG_NONE Weather Parent=[setq(0,u(SUM_ATR,v(PRECIP_HISTORY)))][switch(1,lt(r(0),10),parched,lt( r(0),30),dry,normal)]
&DG_WET Weather Parent=switch(gt(u(SUM_ATR,v(PRECIP_HISTORY)),150),1,flooded,wet)
&DTIDE Weather Parent=switch(gt(%0,10800),1,mid-tide,switch(gt(%0,21600),1,low-tide,high-tide ))
&DTIME Weather Parent=[setq(0,index(v(dtime-list),|,add(u(FN_HOUR),1),1))][extract(r(0),switc h(words(r(0)),2,u(dawn),1),1)]
&FEB Weather Parent=28
&FN_AVERAGE Weather Parent=div([add(%0, %1)], 2)
&FN_DTEMP Weather Parent=switch(div(%0,10),2,switch(gt(%0,25),1,cold,freezing),3,switch(gt(%0,35 ),1,chilly,cold),4,switch(gt(%0,45),1,cool,cold),5,switch(gt(%0,55),1,crisp,co ol),6,switch(gt(%0,65),1,warm,crisp),7,switch(gt(%0,75),1,hot,warm),8,hot,9,ho t,10,hot,11,sweltering,freezing)
&FN_HOUR Weather Parent=first(extract(u(#1928/vtime),4,1),:)
&FN_ROOM_INFO Weather Parent=%r%b%b%b[ljust(name(%0),50)][ljust([name(owner(%0))],14)][rjust([num(%0 )],6)]
&FN_WIND_DIR Weather Parent=[setq(0,add(sub(rand(5),2),v(N_WIND_DIR)))][setq(1,switch(r(0),-2,14,-1 ,15,16,1,17,2,18,3,add(1,r(0))))][extract(v(LIST_WIND_DIRS),r(1),1)]
&FORCE Weather Parent=switch(get(%vw/PRATE),1,very light,2,light,3,steady,4,heavy)
&GROUND_STATUS Weather Parent=switch(gt(sub(secs(),get(%vw/LAST_PRECIP)),86400),1,u(DG_NONE),u(GROUND _WET))
&GROUND_WET Weather Parent=switch(gt(get(%vw/TEMPF),32),1,u(DG_WET),switch(get(%vw/LAST_PRECIP_TYP E),snow,snowy,icy))
&GUSTY Weather Parent=add(10,mul(u(RAND_WIND),2))
&ICUR_TEMP Weather Parent=[setq(0,extract(v(UNHOUR_LIST),add(u(FN_HOUR),1),1))][switch(v(LOCAL_TE MP_BIAS),hot,[add(r(0),fold(FN_AVERAGE, [v(TEMPF)] [v(TEMPF_HI)]))],cold,[add(r(0),fold(FN_AVERAGE, [v(TEMPF)] [v(TEMPF_LO)]))],[add(r(0),v(TEMPF))])]
&JAN Weather Parent=20
&JUL Weather Parent=80
&JUN Weather Parent=72
&LIST_WIND_DIRS Weather Parent=north north-northeast northeast east-northeast east east-southeast southeast south-southeast south south-southwest southwest west-southwest west west-northwest northwest north-northwest
&LOCAL_PRECIP_BIAS Weather Parent=[switch(u(season),winter,50,spring,0,fall,0,-50)]
&LOCAL_SKY_BIAS Weather Parent=[switch(u(season),winter,110,spring,50,fall,50,0)]
&LOCAL_WIND_BIAS Weather Parent=0
&MAR Weather Parent=36
&MAY Weather Parent=65
&NOV Weather Parent=46
&N_WIND_DIR Weather Parent=2
&OCT Weather Parent=60
&RAND_WIND Weather Parent=fdiv(rand(100),20)
&RAND_WORD Weather Parent=extract(v(%0),add(1,random(words(v(%0)))),1)
&SEASON Weather Parent=[setq(0,gt(u(day),21))][switch(extract(ulocal(#1928/cur-time),2,1),Jan,w inter,Feb,winter,Mar,switch(r(0),1,spring,winter),Apr,spring,May,spring,Jun,sw itch(r(0),1,summer,spring),Jul,summer,Aug,summer,Sep,switch(r(0),1,fall,summer ),Oct,fall,Nov,fall,Dec,switch(r(0),1,winter,fall))]
&SEP Weather Parent=74
&SET_PRECIP Weather Parent=&LAST_PRECIP %vw=secs(); @switch/first add(rand(120),v(PRECIP_BIAS))=>140,&PRATE %vw=4,>100,&PRATE %vw=3,>40,&PRATE %vw=2,&PRATE %vw=1; @switch/first get(%vw/TEMPF)=>76,&PRECIP %vw=rain,>50,{@switch rand(100)=>95,&PRECIP %vw=hail,&PRECIP %vw=rain},>40,{@switch/first rand(100)=>95,&PRECIP %vw=hail,>90,&PRECIP %vw=snow,>78,&PRECIP %vw=sleet,>40,&PRECIP %vw=fr_rain,&PRECIP %vw=rain},>32,{@switch rand(100)=>80,&PRECIP %vw=sleet,&PRECIP %vw=snow},&PRECIP %vw=snow; @wait 5={&LAST_PRECIP_TYPE %vw=get(%vw/PRECIP); &ground %vw=u(DGROUND)}
&SET_SKY Weather Parent=@switch/first add(rand(110),v(SKY_BIAS),v(LOCAL_SKY_BIAS))=>97,{&sky %vw=overcast; @switch v(OLD_SKY)=overcast, @trig me/SET_PRECIP, cloudy, {@switch add(rand(100),v(PRECIP_BIAS),u(LOCAL_PRECIP_BIAS))=>90, @trig me/SET_PRECIP},some_clouds,{@switch [add(rand(100),v(PRECIP_BIAS), u(LOCAL_PRECIP_BIAS))]=>120, @trig me/SET_PRECIP}, {&PRECIP %vw=none; &PRATE %vw=0}},>78,{&SKY %vw=cloudy; &PRECIP %vw=none; &PRATE %vw=0},>55,{&sky %vw=some_clouds; &PRECIP %vw=none; &PRATE %vw=0},{&sky %vw=clear; &PRECIP %vw=none; &PRATE %vw=0}
&SET_TEMP_CUR Weather Parent=&TEMPF %vw=[setq(0,u(ICUR_TEMP))][r(0)]; &TEMP %vw=u(FN_DTEMP,r(0)); &TEMPC %vw=round(fdiv(mul(5,sub(r(0),32)),9),1)
&SET_TEMP_DAY Weather Parent=&TEMPF me=u(TRAND);&TEMPF_HI me=add(v(TEMPF),rand(10));&TEMPF_LO me=sub(v(TEMPF),rand(10));@switch v(LOCAL_TEMP_BIAS)=hot,{@switch/first rand(100)=>75,hot,>10,normal,cold},cold,{@switch/first rand(100)=>75,cold,>10,normal,hot},{@switch/first rand(100)=>90,hot,>80,cold,normal};@trig me/SET_TEMP_CUR
&SUM_ATR Weather Parent=fold(sum_atr2,%0)
&SUM_ATR2 Weather Parent=add(%0,%1)
&TALLY_PRECIP Weather Parent=&PRECIP_HISTORY me=[rest(v(PRECIP_HISTORY))] [v(DAY_PRECIP)]; &DAY_PRECIP me=0; &PRECIP_TOTAL %vw=u(SUM_ATR,v(PRECIP_HISTORY)); @switch/first get(%vw/PRECIP_TOTAL)=>100,&WATER_TABLE %vw=flooded,>80,&WATER_TABLE %vw=high,>25,&WATER_TABLE %vw=normal,>10,&WATER_TABLE %vw=low,&WATER_TABLE %vw=dry
&TRAND Weather Parent=[setq(0, inc(rand(15)))][setq(1, v(extract(u(#1928/vtime),2,1)))][switch(v(local_temp_bias),hot,[add(r(1),r(0 ))],cold,[sub(r(1),r(0))],[r(1)])]
&T_DAY Weather Parent=&N_WIND_DIR me=rand(16); @trig me/tally_PRECIP; &sky_BIAS me=v(T_SKY_BIAS); &PRECIP_BIAS me=v(t_PRECIP_BIAS); &WIND_BIAS me=v(T_WIND_BIAS); &T_SKY_BIAS me=u(BIAS); &t_PRECIP_BIAS me=u(BIAS); &T_WIND_BIAS me=mul(abs(u(BIAS)),2); @trig me/SET_TEMP_DAY; &SEASON %vw=u(SEASON); &P_PRECIP_TOM me=u(dBIASRAIN,v(t_PRECIP_BIAS)); &P_SKY_TOM me=u(dBIAS_CLOUD,v(T_SKY_BIAS)); &MOON %vw=u(#1928/moon-phase-unadjusted); &D_SKY_BIAS me=u(dBIAS_CLOUD,v(sky_BIAS)); &D_PRECIP_BIAS me=u(dBIASRAIN,u(PRECIP_BIAS)); @pemit %#=[name(me)] - Daily update completed.
&UNHOUR Weather Parent=extract(v(UNHOUR_LIST),u(FN_HOUR),1)
&UNHOUR_LIST Weather Parent=-1 -2 -3 -4 -3 -2 -2 -1 0 1 2 3 5 6 7 8 7 6 5 4 3 2 1 0
&WINDY Weather Parent=add(20,mul(u(RAND_WIND),2))
@VZ Weather Parent=#672
@VW Weather Parent=#1928
&T_SKY_BIAS Weather Parent=-2
&T_PRECIP_BIAS Weather Parent=30
&T_WIND_BIAS Weather Parent=44
&P_PRECIP_TOM Weather Parent=definite
&P_SKY_TOM Weather Parent=clouds
&D_SKY_BIAS Weather Parent=overcast
&PRECIP_HISTORY Weather Parent=0 5 1 0 0 7 0 0 5 10
&TEMPF Weather Parent=68
&SKY_BIAS Weather Parent=47
&PRECIP_BIAS Weather Parent=7
&WIND_BIAS Weather Parent=92
&TEMPF_HI Weather Parent=72
&TEMPF_LO Weather Parent=66
&OLD_TEMP Weather Parent=warm
&C_ATTR Weather Parent=sky
&T_HOUR Weather Parent=&WIND_DIR %vw=u(FN_WIND_DIR); &OLD_PRATE me=get([v(vw)]/PRATE); &OLD_PRECIP me=get([v(vw)]/PRECIP); &OLD_SKY me=get([v(vw)]/SKY); &OLD_WIND me=get([v(vw)]/WIND); &OLD_TEMP me=get([v(vw)]/TEMP); &OLD_DAYTIME me=get([v(vw)]/DAYTIME); &DAY_PRECIP me=add(v(DAY_PRECIP),get([v(vw)]/PRATE)); @trig me/SET_SKY; @trig me/SET_TEMP_CUR; &WIND_SPEED %vw=[setq(5,u(WIND_SPEED_CHOOSE))][u(r(5))]; &WIND_SPEED_N %vw=round(mul(get([v(vw)]/WIND_SPEED),.8689756),1); &WIND_SPEED_K %vw=round(mul(get([v(vw)]/WIND_SPEED),1.6093636),1); &WIND %vw=r(5); &GROUND %vw=U(DGROUND); @@ @pemit #2691= -=%chWeather%cn=- Hey! I'm doing an hourly.
&WIND_SPEED_CHOOSE Weather Parent=[setq(0,div(add(v(WIND_BIAS),v(LOCAL_WIND_BIAS)),10))][switch(r(0),0,ca lm,1,calm,2,breezy,3,breezy,4,breezy,5,gusty,6,gusty,7,gusty,8,windy,9,highly_ windy,calm)]
&DTIME-LIST Weather Parent=night|night|late-night|late-night|late-night|late-night|dawn sunrise|dawn sunrise|morning|morning|midmorning|late-morning|midday|afternoon|afternoon|mid afternoon|late-afternoon|dusk sunset|twilight|evening|evening|evening|night|night
&HIGHLY_WINDY Weather Parent=add(30,mul(u(RAND_WIND),4))
&LOCAL_TEMP_BIAS Weather Parent=hot
&D_PRECIP_BIAS Weather Parent=possible
&TRIG_EMITS Weather Parent=@trigger #1934/routine-hour;@trigger #1934/routine-time-of-day; @trigger #1934/routine-tide; @trigger #1934/routine-moon; @trigger #1934/routine-sun; @trigger #1934/routine-sky
&T_QUARTER Weather Parent=@trig me/TRIG_EMITS;@@ @pemit #2691=-=%chWeather%cn=- Hey! I'm doing a quarterly.;&DAYTIME %vw=u(DTIME);&TIDE %vw=u(#1928/tide)
&TRIGGER-AT-EVERY~HOUR Weather Parent=@trigger me/T_HOUR
&OLD_PRATE Weather Parent=0
&OLD_PRECIP Weather Parent=none
&OLD_SKY Weather Parent=overcast
&OLD_WIND Weather Parent=highly_ windy
&FN_MONTH Weather Parent=[extract(u(#1928/vtime),2,1)]
&TRIGGER-AT-DAWN Weather Parent=&N_WIND_DIR me=rand(16); @trig me/tally_PRECIP; &sky_BIAS me=v(T_SKY_BIAS); &PRECIP_BIAS me=v(t_PRECIP_BIAS); &WIND_BIAS me=v(T_WIND_BIAS); &T_SKY_BIAS me=u(BIAS); &t_PRECIP_BIAS me=u(BIAS); &T_WIND_BIAS me=mul(abs(u(BIAS)),2); @trig me/SET_TEMP_DAY; &SEASON %vw=u(SEASON); &P_PRECIP_TOM me=u(dBIASRAIN,v(t_PRECIP_BIAS)); &P_SKY_TOM me=u(dBIAS_CLOUD,v(T_SKY_BIAS)); &MOON %vw=u(#1928/moon-phase-unadjusted); &D_SKY_BIAS me=u(dBIAS_CLOUD,v(sky_BIAS)); &D_PRECIP_BIAS me=u(dBIASRAIN,u(PRECIP_BIAS)); @pemit %#=[name(me)] - Daily update completed.
&CREDITS Weather Parent=Keran for her Weather and Time System and this system is from the Coders at Pacifica
@set Weather Parent=QUIET
@set Weather Parent=HALTED
@set Weather Parent=SAFE

------extPart_000_004A_01C15759.56D9BA60--