lsmail and evars Thread last updated on 2004-06-04 12:50:08

Posted by member 88697 on 2004-06-03 06:34:06

Hi!
I'm just trying to create a theme and have a problem with lsmail.
I want to hide it, if there is no mail and tried to do this with a timer and a bang.
Now my problem is that mzscript pops up a msgbox telling me, that the evar isn't set. Well, thats true, because it's set after lsmail checks for mail.
But if I set it in my scripts, it never gets changed, so what can I do to let this work without this "evar not set" error?

Posted by member 88697 on 2004-06-03 06:37:42 link

Ehm, the var I am talking about is $LsMailNumMessages$.
And I get the error on this line:
*script gotoif ("$LsMailNumMessages$" = "0") hide

Posted by member 7223 on 2004-06-03 09:46:22 link

First, put this in your theme.rc (or somewhere else):
LsMailNumMessages 0


Now, make sure you're using mzscript-0.9beta_12 and replace your guilty line with this:
*script gotoif ("%#LsMailNumMessages%#" = "0") hide


Explanations (using xLabel-3.0's !setevar) :
!alert $LsMailNumMessages$

Gives "0"
!setevar LsMailNumMessages 2
!alert $LsMailNumMessages$

Gives "0"
Now, here's the magic:
!exec !alert %#LsMailNumMessages%#


Gives "2"

Posted by member 88697 on 2004-06-03 11:08:32 link

Thanks for your help, but there is one thing I don't understand.
I downloaded xLabel-3.0-RC3 and loaded it, but when I try to test what you've posted and type
!exec !alert %#LsMailNumMessages%#

I only get a messagebox with %#LsMailNumMessages%# in it, instead the value :(

It does not seem to accept the escape sequences, but I don't understand why.

Posted by member 7 on 2004-06-03 14:37:00 link

Make sure you have the latest mzscript build.

Posted by member 7223 on 2004-06-03 16:15:01 link

hum... people and the reading...

Posted by member 88697 on 2004-06-04 12:32:44 link

Oh, I'm sorry for that, the docs said it was mzscript-0.9beta_12 but the dll was an old one.

Now I have a new problem that I didn't have before :(
The !IfEq bang doesn't work, I always get an exception error.

Even this little "test theme" does not work:

step.rc:
ThemeDir "$LiteStepDir$themes\mz\"
ConfigDir "$ThemeDir$config\"
ModulesDir "$ThemeDir$modules\"

LoadModule "$ThemeDir$modules\mzscript.dll
LoadModule "$ThemeDir$modules\hotkey.dll

*mzScriptFile "$ConfigDir$scripts.rc"

scripts.rc:
*script var test "1"
*Script bang !test
*Script exec !ifEq test "1" !alert
*Script ~bang

*script start !test


I have tryed over an hour to get this to work, but it's always an exception during bang execution. It works fine with releases older than 0.9.

Help a noob please :/

Posted by member 88697 on 2004-06-04 12:50:08 link

ah,
*script var test "1"

doesn't work anymore :|

ok, understood it :)