New re-hooking script Thread last updated on 2004-07-24 13:55:49

Posted by member 12025 on 2004-07-24 13:54:49

Note: xlabels cannot be hooked back into other xLabels at the moment. I've asked why, and why xLabel crashes on !recycles after a !reload, over at LS-Universe.info. So currently two of the boxes I will use in my theme shall require a !recycle, while the rest shall be fine.

This is a script that will reload modules hooked into xLabels without a !recycle. So far it seems they get hooked automatically, and only a !(module)Show is required.

step.rc:
;------------------------------------------------------------------------------
; Reload timers
;------------------------------------------------------------------------------

*timer reload_this p 20 !reload_this_part_2
*timer reload_this_2 p 20 !reload_this_part_3

script.rc:
;------------------------------------------------------------------------------
; Reload!
;------------------------------------------------------------------------------

*script bang !reload_this ; \hidebang(s) \box name(s) \module(s) \hookbang(s) \showbang(s)

*script exec !varSaveAll
*script exec !reload

*script exec !varSet tmp_hidebangs %{\1}
*script exec !varSet tmp_boxes %{\2}
*script exec !varSet tmp_boxes_two %{\2}
*script exec !varSet tmp_modules %{\3}
*script exec !varSet tmp_hookbangs %{\4}
*script exec !varSet tmp_showbangs %{\5}

*script Label hidebangs
*script exec !exec %{tmp_hidebangs:}
*script GotoIf ( "%{tmp_hidebangs:_}" = "" ) boxes
*script exec !varSet tmp_hidebangs %{tmp_hidebangs:_}
*script Goto hidebangs

*script Label boxes
*script exec !LabelDestroy %{tmp_boxes:}
*script GotoIf ( "%{tmp_boxes:_}" = "" ) modules
*script exec !varSet tmp_boxes %{tmp_boxes:_}
*script GotoIf ( "%{tmp_boxes}" "" ) boxes

*script Label modules
*script exec !Netreloadmodule %{tmp_modules:}
*script GotoIf ( "%{tmp_modules:_}" = "" ) labels
*script exec !varSet tmp_modules %{tmp_modules:_}
*script GotoIf ( "%{tmp_modules}" "" ) modules

*script Label labels
*script exec !labelCreate %{tmp_boxes_two:}
*script GotoIf ( "%{tmp_boxes_two:_}" = "" ) timer
*script exec !varSet tmp_boxes_two %{tmp_boxes_two:_}
*script GotoIf ( "%{tmp_boxes_two}" "" ) labels

*script Label timer
*script exec !timerstart reload_this
*script ~bang
*script bang !reload_this_part_2

*script GotoIf ( "%{tmp_hookbangs}" = ":" )
*script Label hookbangs
*script exec %{tmp_hookbangs:}
*script GotoIf ( "%{tmp_hookbangs:_}" = "" ) timer_two
*script exec !varSet tmp_hookbangs %{tmp_hookbangs:_}
*script GotoIf ( "%{tmp_hookbangs}" "" ) hookbangs

*script Label timer_two
*script exec !timerstart reload_this_2
*script ~bang
*script bang !reload_this_part_3
*script Label showbangs
*script exec %{tmp_showbangs:}
;*script alert %{tmp_showbangs:}
*script GotoIf ( "%{tmp_showbangs:_}" = "" ) end
*script exec !varSet tmp_showbangs %{tmp_showbangs:_}
*script GotoIf ( "%{tmp_showbangs}" "" ) showbangs

*script Label end
*script ~bang

examples (lone ":" as a parameter placeholder, as the rehooking !bangs ar enot needed for the modules I have loaded right now):
!reload_this "!commandHide" "cmdBox" "lsxcommand-1.9.3" ":" "!commandshow"
!reload_this "!vwmHide:" "vwmBox" "rabidvwm-1.1.1" ":" "!vwmshow"
!reload_this "!commandHide:!trayhide" "cmdBox:trayBox" "lsxcommand-1.9.3:vtray-1.10" ":" "!commandshow:!trayShow"