mzScript Thread last updated on 2003-05-12 04:25:39

Posted by member 23979 on 2003-05-07 06:10:21

I am trying to get the first argument of a called bang.
*Script bang !Say2bob
*Script exec !msgbox %{\1}" Bob!"
*Script ~bang

I use:
mzScriptNewSyntax true

So I can do things like
*Script exec !Say2bob "Hello"
*Script exec !Say2bob "Go away"

It's just an example, I need for other things :)

Posted by member 7223 on 2003-05-07 06:56:51 link

Since,
mzscript 0.9 preview (2002-04-12) / ilmcuts
- vars are now defined in separate files (*mzVarFile)
- multiple script files allowed (*mzScriptFile)
- added mzScriptUseStep, this will also use step.rc as a scriptfile like mzscript did in 0.8
- vars defined with *script var (old syntax possible ;)) won't be saved
- step.rc will be processed last
- vars added at runtime cannot be saved (mzAutosaveVars & !varSaveAll syntax changed)
- script *start items are now executed last
- mzNoStartOnRefresh will disable the *start items on !refresh
- %{} is now the default syntax
- use mzScriptOldSyntax to work with %[].

Posted by member 23979 on 2003-05-07 08:03:22 link

I just would like to know how to access arguments passed to a bang.

Posted by member 7 on 2003-05-07 08:15:06 link

You need a 0.9 preview version.

Posted by member 23979 on 2003-05-07 11:30:56 link

My fault, I was using 0.8.6 .

I tried 0.9 (jam4) but somehow nothing works anymore :-/
Any clues, what I should look for.
I already recognized that the syntax seems to have changed to include the script file (leading *).

I am using "non|step".

Posted by member 23979 on 2003-05-07 11:54:19 link

Are there any themes using current versions of mzScript I could look at for examples?

Posted by member 7223 on 2003-05-07 15:28:03 link

My themes always need the last version of mzscript (and make a great use of it)
...but they're not well commented

Posted by member 23979 on 2003-05-07 17:36:22 link

I tried several mzScript dlls (v0.9xxx also from the last desktopian). If I load it the first time it works fine, after some recycles, it does quit bangs premature and finally I get this error:

Error: Could not register window class

Posted by member 7223 on 2003-05-07 18:49:29 link

kromo: I think it's not mzscript's fault. It should be due to some modules. Don't know which, but I had the same error with several modules:
- WharfX
- skinbox (when RabidVWM is hook in a box)
- IDontRemember...

Simply create a script like this:
*Script Bang !SoftRecycle
*Script Exec !UnloadModule "ModuleSuspected.dll"
*Script Exec !UnloadModule "ModuleSuspected.dll"
...
*Script Exec !Recycle
*Script ~Bang


and call !SoftRecycle instead of the regular !Recycle


Have fun with mzscripts...

Posted by member 1 on 2003-05-07 19:55:16 link

I am running mzScript .9 at home and recycle about 20 times a day in theme development. No issues...sorry.

Posted by member 23979 on 2003-05-08 03:47:51 link

I am writing this after a "cold start" and my script (which worked fine with 0.8.6, expect arguments) will not be fully executed. I tried to use !msgbox as breakpoints but the results are not ver reproducable. In other "languages" I would suspect a memory leak (could be in one of the other modules, but it worked with the older version).


I am using:

ckHotpots: 2.3 (Chsyaku, Hollow)
stray2.dll: 1.89
layercut.dll: 1.6
Razrez.dll: 0.4 (azathoth/ilmcuts)
Label 1.99
hotkey.dll: 1.6
LsxCommand 1.8.3
LsSlider.dll: 1.71
jAmpToo v1.3
Geekamp 1.9.666 (RIP Azathoth)
textedit.dll: 2.4.12 (phil)
Tasks 0.92b3
popup2.dll: 1.16
jdesk.dll: 0.711
RabidVWM.dll: 1.01 r

Posted by member 7 on 2003-05-08 06:19:37 link

Read the changelog. It's at the top of the readme. 0.9 is not backwards compatible.

Posted by member 7223 on 2003-05-08 07:03:34 link

You should always use lastest release of mzscript. It works fine for me.
The only backward compatibility problem I know is about vars. But you already know the new syntax.
I don't know if it has been fixed, but since the june release, there's was a bug that messing saving of vars that not "SingleWordOnly"...

I don't know what could be wrong in your case

Posted by member 7 on 2003-05-08 07:22:27 link

In fact... I don't recommend using the 0.9 releases unless you really need the features. They are very buggy sadly :(

Posted by member 7223 on 2003-05-08 08:41:59 link

But if you want to pass arguments to !bangs, you need it...

ilmcuts: I'm using it since the first releases (~june 2002) and I don't have problem (except vars saving, but I use TextEdit2 to fix it). And I'm doing extensive use of scripts...
Then...

Posted by member 7 on 2003-05-08 08:48:57 link

If they work for you it's all good, but there are some people that have complained about bugs (including rather nasty ones). I didn't really know what I was doing back then. And I probably still don't know it. :p
The first one was released in the second week of April 2002 btw ;)

Posted by member 23979 on 2003-05-08 09:11:50 link

I didn't know that's that's that much about arguments, since I read something about !VarSwap in the code section and I thought it would be an everyday trick.

btw, which litestep build do you use?

Posted by member 7223 on 2003-05-08 11:33:22 link

The last Indiestep because 0.24.7beta3 doesn't support !SetVar
and I like doing things like:
!Setvar ModuleRCSetting Agrument
!Reload
!Reloadmodule "Module"

Posted by member 7223 on 2003-05-11 20:52:30 link

ilmcuts: i've just found that:
*Script Exec !IfEval ("$TasksDirection$" = "up") |Execute [!VarSet tmp %{tasksiconwidth}][!VarSet tasksiconwidth %{tasksiconheight}][!VarSet tasksiconheight %{tmp}]
use to popup an "error parameter missing"
i've tried:
*Script Exec !IfEval ("$TasksDirection$" = "up") |Execute [!VarSet tmp %{tasksiconwidth}][!VarSet tasksiconwidth %{tasksiconheight}][!Exec !VarSet tasksiconheight %{tmp}]
without success,
but:
*Script Exec !VarSet tmp %{tasksiconwidth}
*Script Exec !IfEval ("$TasksDirection$" = "up") |Execute [!VarSet tasksiconwidth %{tasksiconheight}][!VarSet tasksiconheight %{tmp}]
works !

i guess it's due to !Execute

Posted by member 333 on 2003-05-12 04:25:39 link

don't be hard on your self ilmcuts, I've used your mzscript-updates and they've worked just fine for me. I guess I'm no advanced scripter, but I've had no problems with mzscript.