Posted by member 60 on 2003-02-18 14:32:39 link

timer.dll & mzscript.dll
this probably won't make sense, probably not the most elgant solution but anyway:

;never used timer.dll myself...
*Timer ampm #sl 1m !am_pm_shift

*Script bang !am_pm_shift
*Script exec !ifNExist _clockAmPm !varSet _clockAmPm "na"
;this only works with mzscript .9 something +, with integer compare
; *Script gotoif ( "%[hour]" => "12" ) shift_pm
; now messy mzscript that is string compare only (added x to force string compare)
*Script gotoif ( "%[hour]x" = "0x" ) shift_am
*Script gotoif ( "%[hour]x" = "1x" ) shift_am
*Script gotoif ( "%[hour]x" = "2x" ) shift_am
*Script gotoif ( "%[hour]x" "20000000" = true :P


*Script label shift_am
*Script gotoif ( "%[_clockAmPm]" = "am" ) shift_exit ;no need to change indicator
*Script exec !varSet _clockAmPm "am"
;required bangs to show am indicator/hide pm
*Script goto shift_exit


*Script label shift_pm
*Script gotoif ( "%[_clockAmPm]" = "pm" ) shift_exit ;no need to change indicator
*Script exec !varSet _clockAmPm "pm"
;required bangs to show pm indicator/hide am
*Script goto shift_exit


*Script label shift_exit
*Script exit
*Script ~bang