Posted by member 212670 on 2005-11-22 14:13:04 link

!AmpPowerOn? What module uses that? Doesn't look familiar. Also, the !setampvar wasn't intended to be used in a script alone. It was a companion script (to be used with the !playpause script) to be fired by a dummy label.

Ok, this hand holding might make DeV cringe :), but here's a step by step for you. Do this to a fresh Reluna install (this has been tested, and is confirmed to work):

1. Add to the theme.rc:
*NetLoadModule mzscript-0.9.13
*mzScriptFile "$ConfigDir$script.rc"

*Label ampdummy
ampdummyX -1
ampdummyY 0
ampdummyWidth 1
ampdummyHeight 1
ampdummyText "[WinampStatus]"


2. In the theme's config folder, create a text file, and name it "script.rc"

3. In the newly created script.rc file, add in the following script (each *script starts a new line):
*Script bang !playpause
*Script exec !LabelInfoExport ampdummy amptmp
*Script exec !IfEval ( "%{amptmp}" = "Playing" ) '!varset ampplaying 1' else '!varset ampplaying 0'
*Script gotoif ( "%{ampplaying}" = "1" ) pause
*Script exec !Amp_Play
*Script exit
*Script label pause
*Script exec !Amp_Pause
*Script ~bang


4. Set your hotkey button to use !playpause. For example, the hotkey might look like:
*Hotkey .none AMP_POWERON !playpause


That's it. You're done. Class dismissed.

edited 4:45pm est. Changed the script in step 3. I was being too redundant. Moved the original step 4 to be part of step 1.

-----------------------------------------------------------

Note: For anyone else trying this, it will NOT work as-is with xlabel 3.4.8. The dummy label has to be large enough to hold the entire play/pause text, due to the "ellipsis (...)" change. But, this will work perfectly for Reluna, which uses an older version.