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 :)
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 %[].
I just would like to know how to access arguments passed to a bang.
You need a 0.9 preview version.
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".
Are there any themes using current versions of mzScript I could look at for examples?
My themes always need the last version of mzscript (and make a great use of it)
...but they're not well commented
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
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...
I am running mzScript .9 at home and recycle about 20 times a day in theme development. No issues...sorry.
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
Read the changelog. It's at the top of the readme. 0.9 is not backwards compatible.
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
In fact... I don't recommend using the 0.9 releases unless you really need the features. They are very buggy sadly :(
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...
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 ;)
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?
The last Indiestep because 0.24.7beta3 doesn't support !SetVar
and I like doing things like:
!Setvar ModuleRCSetting Agrument
!Reload
!Reloadmodule "Module"
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
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.