thisisauniqueusername
10-28-2008, 04:12 PM
Is there a way to execute code that is stored in a string in AMS?
Currently I can write the string to a file and then run the file like:
myScript="Debug.ShowWindow(true);Debug.Print('Hello World');"
myLocation="C:\\MyFile.lua"
TextFile.WriteFromString(myLocation, myScript, false);
Application.RunScriptFile(myLocation);
or I can assign it to a hotspot and then execute the on click event like:
myOtherScript="Debug.ShowWindow(true);Debug.Print('Goodbye World');"
Page.SetObjectScript("MyHotspot", "On Click", myOtherScript);
Page.ClickObject("MyHotspot");
Is it possible to just do some type of eval(myScript)?
This would be used with pulling scripts from a MYSQL/SQLLITE DB and then executing them. They would all be valid Lua Scripts.
Currently I can write the string to a file and then run the file like:
myScript="Debug.ShowWindow(true);Debug.Print('Hello World');"
myLocation="C:\\MyFile.lua"
TextFile.WriteFromString(myLocation, myScript, false);
Application.RunScriptFile(myLocation);
or I can assign it to a hotspot and then execute the on click event like:
myOtherScript="Debug.ShowWindow(true);Debug.Print('Goodbye World');"
Page.SetObjectScript("MyHotspot", "On Click", myOtherScript);
Page.ClickObject("MyHotspot");
Is it possible to just do some type of eval(myScript)?
This would be used with pulling scripts from a MYSQL/SQLLITE DB and then executing them. They would all be valid Lua Scripts.