Problems with MzScript and LsBox Thread last updated on 2004-06-01 07:00:56

Posted by member 138111 on 2004-05-30 20:59:02

Well, for a start, let me say that Im not really sure if these problems are related, but one has followed the other..

The problems began when I found that some of my modules (Jamptoo, Vtray, Kclock, RabidVWM, LSXCommand, LSbox, and the shortcuts created using Layercut) were staying on top whilst I was playing full screen games. So, I decided to create a script using MzScript that would toggle the visibility of these modules.
I downloaded MzScript, added the loadmodule line, and wrote these lines into step.rc:

*script bang !toggledesktop
*script exec !kclocktoggle
*script exec !togglecommand
*script exec !VWMshow toggle
*script exec !ShortcutGroupToggle 100
*script exec !vtraytoggle
*script exec !jamptoggle
*script exec !LsBoxToggle slider
*script ~bang


Unfortunately, when I type "!toggledesktop" into LsxCommand, it does nothing..
I've also tried placing the code in a "scripts.rc" file, and using the "mzScriptFile "C:\scripts.rc" " command to link the two.
I am now completely stumped, and fear I've made some kind of newbie mistake. Any help would be welcome!


The second problem developed when I finally gave up on trying to make MzScript work, and just deleted the whole thing from my step.rc.
Basically, the problem is that the LsBox containing LsSlider is no longer showing, there is just a rectangular gap where the box should be. Attempting to toggle the visibility of the box by typing "!lsboxtoggle slider" into LsxCommand has resulted in the message "Box SLIDER not found".
I have tried this command using quotations around the name, and using the name of the actual box file, all to no success.
I have totally _no_ idea why this has gone wrong, because it worked fine for many a day, and I have made no changes to its code. Here is the script I am using.

Step.rc -
*LsBoxCreate "c:\slider.box"


slider.box -
LsBoxName slider

LsBoxX 608
LsBoxY 14
LsBoxHeight 16
LsBoxWidth 120

*modulehook !Sliderhook "Winamp" 0 0 11 sliderback.bmp Slider.bmp HAI [VOLUME] 0

LsBoxAlphaTransparency 200


Now Im not sure what the problem is at all.. I've moved the order of the LoadModule commands (under advice, I have loaded LsBox last), I have changed the positioning of the LsBox, and the Slider within, just to find out if I've secretly hidden it under something, I have also renamed the file, moved it around, changed the path, and reinstalled both modules. I literally have no idea what is going on, but once again I feel I've made some form of newbie mistake.

Well, I hope some of you guys can help me with my problems, and I hope to hear from you soon.

Thanks in advance!

Posted by member 12025 on 2004-05-30 21:13:26 link

Try just putting the mzScript bang into the theme.rc, and have
*mzScriptFile "$ThemeDir$theme.rc"
That should take anything like the wrong settings out for the time being. Also, add a !msgbox "something" in there, as that will show you something as it executes. The script looks fine to me.

On the box, that's LsBox telling you it doesn't like you. There's something wrong in the box setup. I don't know what, as often the slightest thing can ruin LsBox (could be no background specified?).

I recommend a switch to xLabelLight. I've found it much easier to work with (and in 3.0 final, !LabelCreate works). If you don't use the LsBox docking, then xLabelLight 3.0 will do everything needed, and more.

Posted by member 138111 on 2004-05-30 21:42:39 link

Thanks for your help man! Unfortunately, I tried doing what you said with MzScript, and still no success. i did what you suggested with the "!msgbox "something" " line, and I didnt get an box popping up either..
See, this just confused me, because surely if the box isn't popping up, then the script is not executing, and surely if the script is not executing, there is something wrong with the code, but the code looks fine..

horror :(



Does xLabelLight support transparency? Actually, dont answer that, I'll go find out. Transparency is the only reason I've got LsSlider in the box :)
When I tried to use GrdTransparent on LsSlider, I achieved an instant shell crash, so I took some advice and whacked it in a box, then set the box as transparent.

Thanks for your help!

Posted by member 12025 on 2004-05-30 21:54:13 link

Yes, it has transparency, and very well organized docs :).
For mzScript...I dunno.
Use !about. The bang should show up in the list.
*script bang !whatever
and
*script ~bang
should be enough for that.
Also, use beta 12 if you aren't already. beta 11 and 12 don't have as many problems as previous versions, which could be temperamental(sp), like LsBox.

...wait a second! Do you have
mzScriptFile "C:\scripts.rc"
or
*mzScriptFile "C:\scripts.rc"
?
I didn't notice it before, but your post lacks a * there.

Posted by member 138111 on 2004-05-30 22:05:13 link

Hah! I changed it and it works fine now!
Thats unbelievable, I didnt add the asterix in front of the line because in the MzScript documentation it says..

mzScriptFile filename
- Uses filename as scriptfile instead of step.rc (default step.rc)


Without the asterix, so I presumed it didnt need one! They really should change that in there documentation!

And Im working in xLabel as we speak, I shall tell you the results as soon as I recycle :)

Thanks again!

Posted by member 138111 on 2004-05-30 22:57:39 link

Well, I've tried xLabel, and that seems not to work either.

Lets see now..
*slider "winamp" 608 14 11 sliderback.bmp Slider.bmp HAI [VOLUME] 0

gets me slider in the right place. However, I need it to be transparent, so that doesnt do at all..

using xLabel with the code
*Label slider
sliderX "608"
sliderY "14"
sliderWidth "200"
sliderHeight "16"
*slidermodulehook !sliderhook "winamp" 0 0 11 sliderback.bmp Slider.bmp HAI [VOLUME] 0

Doesnt seem to work either. I've tried moving the LsSlider X and Y positions around, and that didnt do the trick. The Label is definately working, as I wrote
slidertext "why dont you work?"
into it, and it showed up fine, right in the correct place.

So, basically, xLabel works fine, LsSlider works fine, but combined, they form an alliance with the sole purpose of making my brain hurt.

Any ideas? Because I am allll out :(

Posted by member 7223 on 2004-05-31 00:04:01 link

from mzscript-0.9-beta_12.txt:
----- step.rc -----

*mzScriptFile filename
- Read script definitions from filename. Multiple scriptfiles possible. Files may include ; comments.

*mzVarFile filename
- Read %{vars} from filename. Multiples also possible. Files may include ; comments.

mzScriptUseStep
- step.rc and all included files are treated as scriptfiles. these files will be processed after
all *mzScriptFile lines are processed.

Posted by member 12025 on 2004-05-31 00:37:09 link

I don't know what you're doing wrong there with the slider.
I copied and pasted what you got there, adding a *NetLoadModule lsslider-1.71 line, and it worked on recycle. All I changed was the name of the slider background and handle files to ones I already had.

My only problem was that LsSlider is useless. Channel choices are fine, but devices are handy, too. I'm changing the volume of my onboard sound just fine.

Posted by member 138111 on 2004-05-31 05:53:11 link

Smurth: God damn, it appears I've been using an old version all this time. I have mzscript-0.8.6l, and the documentation on that is quite different :)

Cerbie: Im gonna start searching for other slider modules, I have nooo idea whats going wrong, so I think I might give up on it for a while.

Thanks for all your help!

Posted by member 12025 on 2004-05-31 14:27:58 link

There are no other slider modules. Just get that one working. There's got to be a way. How does it work outside a label?

Posted by member 138111 on 2004-05-31 18:13:16 link

It works fine outside of a label, but it wont go transparent. And being as its the only non-transparent module on the desktop, it sticks out like a sore thumb, and ruins the whole feel of the theme. If we could find a way of making it go transparent without putting it in an xlabel or LsBox, we could be onto something.

Posted by member 12025 on 2004-05-31 19:22:28 link

I wonder why it won't work, though?
*NetLoadModule lsslider-1.71
*Label slider
sliderX "608"
sliderY "14"
sliderWidth "200"
sliderHeight "16"
*slidermodulehook !sliderhook "winamp" 0 0 11 blue_box.bmp pink_box.bmp HAI [VOLUME] 0

works fine, just copying, pasting and changing that little bit.

Posted by member 138111 on 2004-06-01 07:00:56 link

*sigh*
Doesnt work at all. I just dont get this, surely this cant be right if Im just copying and pasting that, which works fine on your box, and for some reason it just does nothing on mine?
This is horror. I think I might actually upload my entire theme somewhere, so you guys can have a look, and tell me what it is Im doing wrong.