Posted by member 12025 on 2004-07-28 13:04:05 link
Not really, but look at themese that use reasonably simple scripts, like Pandora, slick, etc.
Also, there's a feature that, while documented technically, isn't well documented for mzScript. You can pass parameters. Now, there are two other tricks here that could help you out. Environment variables weren't meant to be used as anything but read-only values from a text file.
1. make the *mzVarFile themevars.rc, and put all variables in there. So here's what happens:
-LS loads, reads evars, including themevars.rc. No manipulation available.
-MzScript loads, reads themevars.rc for variables. The evars and mzScript vars match at this point.
-MzScript can alter its variables with scripts.
-You recycle or quit (theme change/shutdown/logoff/ included) LS, and the mzScript vars are saved to themevars.rc, so the evars are the right values when it loads next time.
Also, mzScript scripts can take parameters, but it isn't well documented (last I saw, it was only mentioned in the changelog).
So you can make a script, when calling the bang,
This then goes to script, and "hey" is \1, "how" is \2, etc. So you can use !IfEq \2 "hey" {!bangs} or set something as %{\2}misc, etc..
One caution: calling another scripted bang clears these parameters, so if you want to do that, save them to some variables first.
Some of that might be a bit over your head right now, but it comes in handy quite a bit.
Also, there's a feature that, while documented technically, isn't well documented for mzScript. You can pass parameters. Now, there are two other tricks here that could help you out. Environment variables weren't meant to be used as anything but read-only values from a text file.
1. make the *mzVarFile themevars.rc, and put all variables in there. So here's what happens:
-LS loads, reads evars, including themevars.rc. No manipulation available.
-MzScript loads, reads themevars.rc for variables. The evars and mzScript vars match at this point.
-MzScript can alter its variables with scripts.
-You recycle or quit (theme change/shutdown/logoff/ included) LS, and the mzScript vars are saved to themevars.rc, so the evars are the right values when it loads next time.
Also, mzScript scripts can take parameters, but it isn't well documented (last I saw, it was only mentioned in the changelog).
So you can make a script, when calling the bang,
!randombang hey how are you
This then goes to script, and "hey" is \1, "how" is \2, etc. So you can use !IfEq \2 "hey" {!bangs} or set something as %{\2}misc, etc..
One caution: calling another scripted bang clears these parameters, so if you want to do that, save them to some variables first.
Some of that might be a bit over your head right now, but it comes in handy quite a bit.