Trigger to call c++ script

Posted by Ashass on Fri 05 Dec 2008 12:47 PM — 7 posts, 28,435 views.

#0
Is there a way to make a LUA trigger call a c++ script?

Also, is there a way to turn a LUA trigger on/off?
Australia Forum Administrator #1
There is no such thing as a C++ "script" because C and C++ are compiled languages. However see the link below for how you can make your own DLLs (which could be written in C++) for calling from Lua.

This is how a lot of Lua extensions are implemented.

http://www.gammon.com.au/forum/?id=4915


There is no such thing as a "Lua trigger" in MUSHclient (if that is what you are asking about). Any trigger can call a script in the current language. However triggers can be enabled/disabled, see:

http://www.gammon.com.au/scripts/doc.php?function=EnableTrigger


By the way, Lua is the name of the language, it is not an acronym, thus it should be written as Lua, not LUA. See: http://www.lua.org/about.html#name
Netherlands #2
Whatever you are trying, there is a good chance it will be possible already with Lua in its current state. And for as far disabling triggers goes, take a look at the EnableTrigger() function (with a parameter of false to turn it off).
#3
Going to be making this.

http://www.gammon.com.au/forum/?id=9063
Netherlands #4
Don't bother with C/C++. Lua or another scripting language will do just fine.
#5
Yes, they will work just fine, however I don't know how to do all the required things using Lua script or other scripting language, which, as it turns out is why I asked for help.
Netherlands #6
If you know C or C++, Lua should not be that difficult. Read through and use the PiL (http://www.lua.org/pil/) as a guideline, and combine it with the various functions listed in the MUSHclient helpfile.