|
Post by ericzang on Aug 20, 2019 23:16:37 GMT
Anyone know how to call many scripts within a loop? I have many scripts I'd like to call efficiently, such as: G1.tap2(); G2.tap2(); etc...
how can a variable be used so as to make a statement that would function like G{i}.tap2(); ? (had to type curly brackets here instead of square because it invokes italics mode)
decl i; for (i=1;i<17;i++)G{i}.tap2();
using setexpression and/or findobject seems not to apply to create something like the above, nor using a reference to an array in the way I've tried.
Thanks for any ideas!
|
|
|
Post by xPsycHoWasPx on Aug 26, 2019 7:06:52 GMT
You need to create an external script that calls the scripts.
like
Script_handler(input,value)
inside it you will need a lot of if rules
if (input == "G1") G1.tap2(value) else if (input == "G2") G2.tap2(value) and so on..
and then u can call it from the loop value = ?
for (i=1;i<17;i++) Script_handler( ("G" + I) , value)
But I strongly recommend you read the PDFs again, all the stuff it mentions is what u can do in lemur, nothing else.. the only action that can loaded by text strings are Variables and Expressions with setexpresson() and getexpression().
its a really basic C lang they use.
and compared to langs like C++ , Java, Python. its like using Basic on a C64 compared.. another reason why I couldn't stick to lemur anymore..
|
|
|
Post by ericzang on Aug 26, 2019 7:43:20 GMT
Thanks lots again, I see that will be helpful in certain cases where I need to use conditions created in a loop. Yes, thanks for showing a possible way beyond lemur!
|
|
|
Post by xPsycHoWasPx on Aug 26, 2019 11:40:59 GMT
Your welcome. I dont know if you checked one of my old post about wrapping expressions into a big object and easy callable. lemur.boards.net/post/117/threadThis could also give a hint of how to call your scripts / expressions beyond normal lemur experience.
|
|