Hi Jussi,
would be cool to have access to some persistent global Lua state/table/registry across script/macro calls so it would be easy to implement some more advanced macros relying on some former actions/acting incrementally.
Best regards,
Michael
Persistent global Lua state
Hi Michael,
This might be a little difficult to achive since for all the Zeus scripting languages the scripting engine is recreated each time. In other words a new instance of the interpreter is created each time a script is run
But Zeus does offer a very limited amount of global persistence, via the following scripting functions:
For more information about these functions place the cursor on each function in turn and use the Help, Quick Help menu option.
Cheers Jussi
This might be a little difficult to achive since for all the Zeus scripting languages the scripting engine is recreated each time. In other words a new instance of the interpreter is created each time a script is run

But Zeus does offer a very limited amount of global persistence, via the following scripting functions:
Code: Select all
string get_global_string(string item [, int local_scope])
bool set_global_string(string item, string value [, int local_scope])
Cheers Jussi
Hi Jussi,
I've found some script code in the archive pages of your website - is that code the one used in current builds and does Zeus load the DLL on each scriptexec or just initialize the scripting state using an already loaded DLL? If so I may be able to build a modified version for my special needs.
Best regards,
Michael
I've found some script code in the archive pages of your website - is that code the one used in current builds and does Zeus load the DLL on each scriptexec or just initialize the scripting state using an already loaded DLL? If so I may be able to build a modified version for my special needs.
Best regards,
Michael
Hi Michael,
I have update the web page to include the latest source code for the Zeus Lua Scripting module code. To build the scriptlua.dll just download the zip file and follow instructions in the readme.txt file.
Cheers Jussi
I have update the web page to include the latest source code for the Zeus Lua Scripting module code. To build the scriptlua.dll just download the zip file and follow instructions in the readme.txt file.
Below is the code that Zeus uses to run the the script using the dll. I have never checked but I suspect the dll is loaded and unloaded each time a script is run.does Zeus load the DLL on each scriptexec or just initialize the scripting state using an already loaded DLL?
Code: Select all
{
//-- this class wraps aroung the scripting dll
iModule module(szDllName);
//-- run the execute
sResult = msvc_execute(module, pInterface, pszScript);
}
int msvc_execute(iModule &module, xInterface *pInterface, const char *pszScript)
{
int sResult = 0;
//-- get the module proc address
FARPROC farproc = module.proc("execute");
if (farproc)
{
__try
{
//-- get the execute entry point
MACRO_EXECUTE pfnExecute = (MACRO_EXECUTE)farproc;
//-- run the entry point
sResult = (*pfnExecute)(pszScript, pInterface);
}
__except(ExceptionFilter())
{
::MessageBox(0, pszFatal, "Scripting Error", MB_OK | MB_ICONEXCLAMATION);
}
}
return sResult;
}
All the files required to build the dll should be included in the zip file, but if you have any problems building the dll let me know. If you have any questions feel free to post them here or alternatively you can also send me an e-mail.If so I may be able to build a modified version for my special needs.
Cheers Jussi