Flashing labels Thread last updated on 2003-06-10 02:29:10

Posted by member 7223 on 2003-06-10 02:29:10

Don't you ever wanted to have some flashing messages.
Just define the label and call:
!HotMsg "text to display" time (in seconds)

example:
!HotMsg "Action canceled" 20

; change 250 with whatever you want (in ms)
*Timer HotMsg #l 250 !HotMsgCycle


;
; HotMsg
; IN:
; - %{\1} = text to flash
; - %{\2} = duration in seconds (0 = infinite)


*Script Bang !HotMsg
*Script Exec !TimerRemove HotMsgStop
*Script Exec !TimerKill HotMsg
*Script Exec !VarSet HotMsgText "%{\1}"
*Script Exec !VarSet HotMsg 0
*Script Exec !TimerStart HotMsg
*Script Exec !IfNeq \2 "0" |TimerAdd HotMsgStop %{\2}s !HotMsgStop
*Script Exec !TimerStart HotMsgStop
*Script ~Bang

*Script Bang !HotMsgCycle
*Script Exec !IfEq HotMsg "0" '|VarSet HotMsg 1' else '|VarSet HotMsg 0'
*Script Exec !VarSet tmp ""
*Script GotoIf ("%{HotMsg}" = "0") HotMsgNoDisplay
*Script Exec !VarSet tmp "%{HotMsgText}"
*Script Label HotMsgNoDisplay
*Script Exec !LabelSetText "%{tmp}
*Script ~Bang

*Script Bang !HotMsgStop
*Script Exec !TimerRemove HotMsgStop
*Script Exec !TimerKill HotMsg
*Script Exec !LabelSetText "Whatever you want to be permanently displayed"
*Script ~Bang