Phar0e...I need some help with scripts

Phil....I need some help with scripts....

I want to have a script to textedit an ini file in a conditionals statement....namely to relocate the x co-ord in rainmation.ini depending on screen res.

but....

Am stuffed if I can get it to work.......never was the brightest spark with scripts....

4,775 views 18 replies
Reply #1 Top
never was the brightest spark with scripts....

That would make me an icicle with scripts.





Powered by SkinBrowser!
Reply #2 Top
...That's why two sticks come with Popsicles
Reply #3 Top

*Script exec !textreplace $LSImageFolder$vent\Rainmation.ini "X=" "X=700"
That's the sort of thing I need to execute via conditional statement....but I've lost the plot somewher, I think...

Reply #4 Top
How many different values do you want to use for the X coordinate?
If there's just two, there might be any easy way to do it.

If there's more than two, you might want to use an enviromental variable in the ini file. (X=$Spot$)

Then in an rc file define spot:
Spot 100

Then apply a textedit to the spot definition.

But let me know how many different values first.
Reply #5 Top

Hi, Phil.....there'd be a 8 to a dozen or so X co-ords.....one for each resolution....for each rainmation.

Each rainmation has its own ini file....the idea is to use probably three animations....which only means duplicating what works with the first ini file.

Thing is...the rainmation is a fairly old module which might have issues within itself with evars.

I think my problem is with understanding how to have the editing 'executed' through a conditional statement....the actual syntax...

 

Reply #6 Top
Ahh, I think I see.
You could use something like this:

If ResolutionX = 800
X=70
ElseIf ResolutionX = 1024
X=100
ElseIf ResolutionX = 1152
X=120
ElseIf ResolutionX = 1280
X=140
ElseIf ResolutionX = 1600
X=160
EndIf

That kinda thing. You can use simbols too.
Or have I really missed the boat?

Reply #7 Top
Now if the ini files won't work with the resolution evars...
Make the X coordinate in the ini file as "$Spot$" (with no commas)

Then in an rc file do something like this:

If ResolutionX = 800
Spot 70
ElseIf ResolutionX = 1024
Spot 100
ElseIf ResolutionX = 1152
Spot 120
ElseIf ResolutionX = 1280
Spot 140
ElseIf ResolutionX = 1600
Spot 160
EndIf

pretty sure that would do it.
Reply #8 Top
Course if the ini file won't read evars at all, that won't work.
Reply #9 Top
and why not using layercut (under development, PNG support) for the animations and math expressions (for negative or centered) for the coordinates?
this way you can completely avoid scripts and conditional statements.
Reply #10 Top

Phil.....I think it's not that simple....it's a matter of editing the actual ini file that is to be read.

I think it needs the conditional statement to 'launch' the textedit of the ini file....but the code of actual bang and/or exec or script command is where I get lost.

I need a module to execute the text ion......even to just get one input edited....then adapt for multiple conditionals......

ElseIf ResolutionX = 1024
*ckHotspot -260 -20 260 20 !Sys-Show !Sys-Hide Systray
*ckHotspot 0 -20 260 20 !Tsk-Show !Tsk-Hide Tasks
VWMX   480
*Slider "" 560 -37 2 Volume1.png Volume-Handle.png #0ABHTIU [VOLUME] 0
*Script exec !textreplace $LSImageFolder$vent\Rainmation.ini "X=" "X=700"

That's the sort of thing I'm 'trying to do.....the rest of it works of course....just the last line is a dud...

Reply #11 Top
moshi.....if all else fails I may have to do that....you keep pushing me towards layercuts [you must have shares in the company]...but I got stuck on rainmation....and hate to chuck it in without a fight....
Reply #12 Top
you know ... layercut works nicely with lsdynamic (same module author). this way you could not only make an animation disappear at one place and popping it up at an other, but actually move the whole thing across the screen with the speed you´d prefer. with these two modules it would be no problem to port this Aquarium Desktop thing (but for steppers "fun" means something different than fish on the desktop of course).

i have not used Rainmation since a while, but as long as each Rainmation has it´s own window title (find out with WinSpy) it should be possible to move it around with lsdynamic as well.

btw: are you trying to do this with mzscript? then you have to check the docs again. this syntax can´t work. this link might help you: http://leaf.terica.net/tutorials/mzscript-overview.html
Reply #13 Top
Oh, poo....now I can't get the animations to work with layercuts.....someone up there wants me to stop using LS....
Reply #14 Top

Ah....Trial and error.....for the life of me I can be thick sometimes....got it going.....and looks like I might just dispense with rainmation afterall.

 

Thanks, moshi for pushing me over the edge......sometimes the longest journey starts with but one step....

Reply #15 Top
I'm feeling positively proud of myself.....have got things to do exactly what I wanted them to......[I'll relegate rainmation to the history books]....
Reply #16 Top
I'm glad to hear that...
cause the scripting you were talking about was getting faily complex
Reply #17 Top
I'm feeling positively proud of myself


Well gee Honey, we're real proud of you too
Reply #18 Top

Seems the Z-Order of Layercuts is still a bit 'iffy'....but the ANTARES LS theme for OTS2 is up and running.

Animations work OK...which is the main thing....though they aren't as simple to configure as ye olde rainmation was...