First I found a nice chatbot very advanced https://code.google.com/p/program-ab/ unfortunately the bot is in Java written
So I want is to use it in MM so seek possibles to bridge between Lua and Java.
First I found a lots of ways to use Lua in Java but that doesn't allow me to use it I want to call Java from Lua.
I found this http://www.codeproject.com/Articles/228 ... -Using-JNI a C/C++ API to do that.
I already found and complied https://github.com/jmckaskill/luaffi to call any foreign *.dll in Lua.
So the Pipe would be MM=>Lua=>FFI=>my.dll=>Java VM=>Chatbot
The problem I have is how I can save my Java VM Pointer, my C is little rusty but so far I remember I can't save anything(global var) in a *dll because it has no memory on its own. What is needed to save is struct so far I can see, anyone any idea?
Call Java from C to call it from Lua
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Call Java from C to call it from Lua
Jack-of-all-trades, but master-of-only of a few
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Call Java from C to call it from Lua
That seems overcomplicated and difficult.
It might instead be easier to write some bindings so that you can use functions from that library in Lua. Basically, you want to export a .DLL where the exposed functions are Lua callbacks. Now, just drop this into MicroMacro's plugin directory and you're done.
It might instead be easier to write some bindings so that you can use functions from that library in Lua. Basically, you want to export a .DLL where the exposed functions are Lua callbacks. Now, just drop this into MicroMacro's plugin directory and you're done.
Who is online
Users browsing this forum: No registered users and 10 guests