Posted by member 60 on 2003-02-18 14:37:12 link
didn't like my 'lessthen'... will now try with > and <:
*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" <= "23x" ) shift_pm
; with string compare "3" > "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
*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" <= "23x" ) shift_pm
; with string compare "3" > "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