icedsun Posted July 15, 2008 Share Posted July 15, 2008 To any brave soul with the knowledge and expertise necessary to use the MTA:SA Module Devkit: I'm in need of some help in compiling some pre-existing C code into a module for MTA:SA. I have no idea if it's even feasible. The program performs several sets of mathematic and comparator operations on a set of data, and returns an array of the computed results. Sounds simple enough to write in Lua, but due to the length of it - it would take a very long time to convert. So, if anyone has some experience compiling anything for the module devkit, I'd appreciate any help or advice you could give. (Even if it's: "That's just not possible to do.") If it isn't an option, would anyone have any ideas on how to write a module for MTA:SA that would give serverside script the option to call/open a ".exe" file with arguments? (For instance, exporting a function like: executeFile(".\taco.exe 15A 99E 34B") Since I'm able to already compile that C program into a .exe, something like this would be a fair-enough workaround to accomplish the same thing (and probably easier to do than converting the whole program into a module.) Any advice/help/information is always greatly appreciated. Thanks everyone. Link to comment
[UVA]Bart Posted July 15, 2008 Share Posted July 15, 2008 is it for mtasa race mod or the mtasa dm mod ? Link to comment
icedsun Posted July 16, 2008 Author Share Posted July 16, 2008 The dm mod, sorry... should have been more specific. (I'm a latecomer to MTA and dp2 is the only thing I've ever used.) Link to comment
[UVA]Bart Posted July 16, 2008 Share Posted July 16, 2008 im not very good with lua at the moment but i will look and see if i can load a .exe with a lua script, in the mta race mod i could load itunes up from within game and change the song and stuff but i dont know about lua altho i will try Link to comment
icedsun Posted July 17, 2008 Author Share Posted July 17, 2008 If that functionality is already there, I would be quite happy!!! (And something amazing would be added to my server... not going to spoil it yet though.) Link to comment
Ace_Gambit Posted July 17, 2008 Share Posted July 17, 2008 The module devkit is indeed interesting to play with. I've only had a quick look at it but realising what you want shouldn't be too difficult. EDIT: You could add something like this in your module function. system(lua_tostring ( luaVM, 1 )); Where the argument is a command string ("c:\\taco.exe 15A 99E 34B" for example) EDIT: I've attached the module (ml_system.dll). It's a dumb simple demonstration of executing an external file using a module. You can execute a file by calling executeFile(string absolutePathToFileIncludingParameters). Example executeFile("c:\\somerandomapp.exe param1 param2 param3") Link to comment
icedsun Posted July 20, 2008 Author Share Posted July 20, 2008 You're amazing - thank you for taking the time and effort to look into this and even compile a working library for me. This community is very lucky to have such dedicated, helpful, and courteous members. It's much appreciated. When I finish the fruits of my scripting labor, I hope you find the end result enjoyable... (more details to come as I near completion) Thanks again. Wow, after figuring out the proper way to include modules, it worked perfectly! This will do exactly what I needed and I can't possible thank you enough!!! Link to comment
Ace_Gambit Posted July 31, 2008 Share Posted July 31, 2008 No problem. I'm working on a SMTP module to allow basic in-game e-mail services. Link to comment
Recommended Posts