simple mzscript problem Thread last updated on 2003-10-16 00:05:10

Posted by member 12025 on 2003-10-15 22:05:44

http://www.doddstech.com/script.rc
basically I want it to keep the settings when it recycles. If I use !scriptload, it does it fine, so I guess that the two current variables (oh, there will be more...) are not yet initialized at the time it runs any of the 'start' stuff.

What is the best way to get this done?

Posted by member 37809 on 2003-10-15 22:18:58 link

Do you have mzscript loaded last (or after the modules whose bangs you use)? For good measure move *script start's toward the end, too.

Posted by member 12025 on 2003-10-15 22:30:14 link

It is loaded last.
Moving the *script start to the bottom caused it to work upon refreshing (have both open, set it to false, save script.rc and refresh), but the file with the new variable values was missing the line with *script start.
...added a carriage return after the *script start and it works fine. Thanks.

Posted by member 36955 on 2003-10-15 22:33:14 link

a better alternative to the !init scripts and stuff like that would be to use textedit... modify !amp_show, etc to set the mzvar and edit the step.rc line to make it start that way next time, for example
*script bang !sys_show
*script exec !systrayShow
*script exec !textreplace "$ThemeDir$theme.rc "^(SystrayHidden)" "\~\1"
*script exec !varSet tray "true"
*script exec !varReplace tray
*script ~bang

*script bang !sys_hide
*script exec !systrayHide
*script exec !textreplace "$ThemeDir$theme.rc "^\~(SystrayHidden)" "\1"
*script exec !varSet tray "false"
*script exec !varReplace tray
*script ~bang

init scripts are messy, and increase the time for litestep to !recycle

Posted by member 37809 on 2003-10-15 23:42:43 link

@doy: hrm, yea, init scripts spend time having to reconfigure what's already configured once a module is loaded. I'm skeptical about visibility though, for modules that are hidden on start.
Then which way you decide to do it depends on how often you recycle :}

oh, you just pointed out !amp_show
...
Just in case you use dynamp or geekamp, know that these modules register this bang name.

For distinction, I suggest prefixing your scripted-bang names with some character.

Posted by member 12025 on 2003-10-16 00:05:10 link

I'll use textedit once I get it mostly done, and definitely agree about the initialization script, it's just that it is soemthing already tested as a concept that I could start with. I do use dynamp, and it appears the scripted !bang is taking over, and renaming now.
I have a lot to mess with before going into textedit, though it's been uselessly loaded for a good while now.