Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Programming ➜ General ➜ Trigger to call c++ script

Trigger to call c++ script

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ashass   (50 posts)  Bio
Date Fri 05 Dec 2008 12:47 PM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 05 Dec 2008 07:19 PM (UTC)
Message
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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #2 on Sat 06 Dec 2008 02:21 AM (UTC)
Message
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).
Top

Posted by Ashass   (50 posts)  Bio
Date Reply #3 on Tue 09 Dec 2008 02:14 PM (UTC)
Message
Going to be making this.

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

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #4 on Tue 09 Dec 2008 03:16 PM (UTC)
Message
Don't bother with C/C++. Lua or another scripting language will do just fine.
Top

Posted by Ashass   (50 posts)  Bio
Date Reply #5 on Tue 09 Dec 2008 04:00 PM (UTC)
Message
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.
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #6 on Wed 10 Dec 2008 02:10 AM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


26,633 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.