Scripts - closed source
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.
Scripts - closed source
It would be good if the scripts can be pre-compiled so they are closed source.
It might encourage users to share their scripts, since it can be shared in a pre-compiled format.
Part of this reasoning is that developers may want to create versions which can be used free, but also charge those who try and profit off of it, such as gold traders.
It might encourage users to share their scripts, since it can be shared in a pre-compiled format.
Part of this reasoning is that developers may want to create versions which can be used free, but also charge those who try and profit off of it, such as gold traders.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Scripts - closed source
You can. You just first need to download the Lua compiler. Normally, this is included with the library, but since you're probably not interested in coding in C++, you probably won't have that. You can get the binaries here:
http://luabinaries.luaforge.net/download.html
Now, you should probably rename the luac5.x file to just 'luac.exe' (Windows) or 'luac.bin' (Linux).
You should then put luac into one of your system paths (typically, C:/Windows/system32/ in Windows). Now, open your command prompt (Start->Run->cmd) and cd to the directory of the Lua file you want to compile. Use the command "luac -o outfile.lua filename.lua" and it will compile filename.lua and dump outfile.lua file, which is the compiled version of the script.
Although you are fully able to compile your scripts, it might not always be the best solution. Be aware that compiling small scripts often ends up in the file size swelling quite a bit. Also, I believe the Lua compiled format has some endianness issues still, which means that your compiled scripts may not work on other systems. According to the Linux man pages, however, endianness is no longer an issue, but word size is. This means, if your scripts are compiled on a 32bit machine, a 64bit machine cannot use them.
I've attached a working copy of luac for Windows x86 just in case the Lua Binaries site has more problems.
http://luabinaries.luaforge.net/download.html
Now, you should probably rename the luac5.x file to just 'luac.exe' (Windows) or 'luac.bin' (Linux).
You should then put luac into one of your system paths (typically, C:/Windows/system32/ in Windows). Now, open your command prompt (Start->Run->cmd) and cd to the directory of the Lua file you want to compile. Use the command "luac -o outfile.lua filename.lua" and it will compile filename.lua and dump outfile.lua file, which is the compiled version of the script.
Although you are fully able to compile your scripts, it might not always be the best solution. Be aware that compiling small scripts often ends up in the file size swelling quite a bit. Also, I believe the Lua compiled format has some endianness issues still, which means that your compiled scripts may not work on other systems. According to the Linux man pages, however, endianness is no longer an issue, but word size is. This means, if your scripts are compiled on a 32bit machine, a 64bit machine cannot use them.
I've attached a working copy of luac for Windows x86 just in case the Lua Binaries site has more problems.
- Attachments
-
- luac.zip
- (103.77 KiB) Downloaded 165 times
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Scripts - closed source
Probably an Obfuscator is the way to goelverion wrote:You can. You just first need to download the Lua compiler. Normally, this is included with the library, but since you're probably not interested in coding in C++, you probably won't have that. You can get the binaries here:
http://luabinaries.luaforge.net/download.html
Now, you should probably rename the luac5.x file to just 'luac.exe' (Windows) or 'luac.bin' (Linux).
You should then put luac into one of your system paths (typically, C:/Windows/system32/ in Windows). Now, open your command prompt (Start->Run->cmd) and cd to the directory of the Lua file you want to compile. Use the command "luac -o outfile.lua filename.lua" and it will compile filename.lua and dump outfile.lua file, which is the compiled version of the script.
Although you are fully able to compile your scripts, it might not always be the best solution. Be aware that compiling small scripts often ends up in the file size swelling quite a bit. Also, I believe the Lua compiled format has some endianness issues still, which means that your compiled scripts may not work on other systems. According to the Linux man pages, however, endianness is no longer an issue, but word size is. This means, if your scripts are compiled on a 32bit machine, a 64bit machine cannot use them.
I've attached a working copy of luac for Windows x86 just in case the Lua Binaries site has more problems.

- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Scripts - closed source
We could run some tests on the Lua bytecode. I've wrote a small test script which should give us some info.
Here's the source:
I've attached the script (test.lua), compiled Lua binary (testc.lua), and a small (Win32) program that tells you if your computer is big endian or little endian. If you've got a 64bit machine, or if you have a little endian system, try running the compiled script and see what happens.
Here's the source:
Code: Select all
printf("This is a script compiled on a 32bit big endian machine with a 80586 processor.\n");
printf("Counting to ten...\n");
for i = 1, 10 do
print(i);
end
printf("\n\n(7 * 2) + 5 = ");
print( (7 * 2) + 5 );
printf("\n\n");
function testFunction()
printf("This is a test function. If you see this message, the test passed.\n");
end
testFunction();
printf("If you did not just see the \'test passed\' message, the function test has failed.\n");
Re: Scripts - closed source
I know lua can be compiled, but what about our MicroMacro scripts? MicroMacro does the linking required, so how would I go about compiling a Micromacro based script? Wouldn't the Micromacro function calls generate compile errors if we just used luac.exe? 
And once I've done that how would I go about loading it into Micromacro?
Or even better, run it as a stand-alone program.

And once I've done that how would I go about loading it into Micromacro?
Or even better, run it as a stand-alone program.
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Scripts - closed source
micromacro.exe yourscript.zerosignal wrote: And once I've done that how would I go about loading it into Micromacro?
Or even better, run it as a stand-alone program.
Or you could append it to lib.lua via an include. It does work, however I'm not sure if its safe and stable.
Your script will be loaded then everytime you start micromacro.
But being able to compile it into a standalone beats the reason of opensource.
Would probably be against the license. I like MicroMacro this way. I can send you a dll that will be called from micromacro which generates an unique HWID you can use to verify if its a valid copy.Part of this reasoning is that developers may want to create versions which can be used free, but also charge those who try and profit off of it, such as gold traders.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Scripts - closed source
As Lua is a run-time scripting language, it is not linked at compile time. It assumes that stray symbols will be resolved later.I know lua can be compiled, but what about our MicroMacro scripts? MicroMacro does the linking required, so how would I go about compiling a Micromacro based script?
Exactly the same way you load your scripts now. The script is just compiled into a byte-code, which will speed up the load time and make the script non-human-readable.And once I've done that how would I go about loading it into Micromacro?
Or even better, run it as a stand-alone program.
Lua cannot be compiled directly into a stand-alone program. It still requires an interpreter. It is possible to actually compile a Lua script into micromacro.exe, however. This is all within the license.
There is no restriction on redistribution, so he could sell it if he likes. I don't necessarily support the selling of MicroMacro and/or script packages, but I don't want to restrict it's use so much that it becomes useless. But yes, that actually is a pretty good idea with the plugin.3cmSailorfuku wrote:zerosignal wrote:Would probably be against the license. I like MicroMacro this way. I can send you a dll that will be called from micromacro which generates an unique HWID you can use to verify if its a valid copy.Part of this reasoning is that developers may want to create versions which can be used free, but also charge those who try and profit off of it, such as gold traders.
Re: Scripts - closed source
I tried compiling a test file, and running it in MicroMacro, it didn't work for me.

I renamed the "test.out" file, as the forum did not allow the out extension through.
Regarding what I mean by closed source
I'm not sure that your fully understanding what I mean. I'm not talking about releasing a closed source version of MicroMacro, regardless if it infringes on the license or not that would just be a dog act.
I'm talking about the possibility of compiling my scripts so they are closed source, and selling them. Time is money, and if I want to make scripts well, I have to convert the time into money. Since I would spending time on making scripts, those scripts will have to make some money. Or else I would have to find other work and do this as a hobby (which never produces quality software). Granted open-sourcing can with several people (or someone sponging off of spouse, parents, government), but in the several months that I worked on zs_shaiya (that was under GPL) and a several thousand lines of code later, not one person contributed really anything back, with the exception of both of you which helped me with the Micromacro API, and general Lua queries.
I'm too old and have financial obligations, so if I continue to write scripts, I need a way for it to contribute to my bread and butter.

I renamed the "test.out" file, as the forum did not allow the out extension through.
Regarding what I mean by closed source
I'm not sure that your fully understanding what I mean. I'm not talking about releasing a closed source version of MicroMacro, regardless if it infringes on the license or not that would just be a dog act.
I'm talking about the possibility of compiling my scripts so they are closed source, and selling them. Time is money, and if I want to make scripts well, I have to convert the time into money. Since I would spending time on making scripts, those scripts will have to make some money. Or else I would have to find other work and do this as a hobby (which never produces quality software). Granted open-sourcing can with several people (or someone sponging off of spouse, parents, government), but in the several months that I worked on zs_shaiya (that was under GPL) and a several thousand lines of code later, not one person contributed really anything back, with the exception of both of you which helped me with the Micromacro API, and general Lua queries.
I'm too old and have financial obligations, so if I continue to write scripts, I need a way for it to contribute to my bread and butter.
- Attachments
-
- test.out.txt
- (1.31 KiB) Downloaded 167 times
-
- test.lua
- (907 Bytes) Downloaded 191 times
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Scripts - closed source
My bad, you have to add scripts/test.out. It works here.
I assume everyone here could need a little money, I'm too young and I need money, for example I'm working on Japanese -> English translations for Aer*agames and I get $50 per Batch which is done in about 30 minutes. I'm using that money to invest into stocks, which is very successful if you have alot of self discipline.zerosignal wrote: I'm too old and have financial obligations, so if I continue to write scripts, I need a way for it to contribute to my bread and butter.
Though I never seen someone trying hard to make money of a macro.
Of course that Shaiya Dongle that bypasses the "Anticheat" protections, which is srsly a dumb macro, you should fix that for them and get paid.
But the only profitable bots I know of are those that are being sold to Goldcompany's, and they're really hardcore.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Scripts - closed source
I compiled your test script and ran it here just fine. Are you maybe on a 64bit machine? Did you use the 64bit Lua compiler?
Re: Scripts - closed source
What about if I just want to hide the main code but let the user modify the parameters? Sort of idiot-proofing my scripts...
Re: Scripts - closed source
@elverion
No, and yes I am using a 64-bit machine, which is probably the issue. I'll take another look at it.
edit:
I compiled with the Win64 binaries, did you use the "test.out.txt" file. or compile it yourself first?
I tried using the Win32 binaries and it worked for me which is great.
So you can have a main script that's compiled, and a config.lua that's uncompiled, then in the main file just call it like so:
As always, thanks for the support.
No, and yes I am using a 64-bit machine, which is probably the issue. I'll take another look at it.
edit:
I compiled with the Win64 binaries, did you use the "test.out.txt" file. or compile it yourself first?
I tried using the Win32 binaries and it worked for me which is great.

I was curious about this so I tested it, using the include function, you can include un-compiled scripts, and it will compile them on-the-fly.DarkP wrote:What about if I just want to hide the main code but let the user modify the parameters? Sort of idiot-proofing my scripts...
So you can have a main script that's compiled, and a config.lua that's uncompiled, then in the main file just call it like so:
Code: Select all
include("config.lua");
As always, thanks for the support.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Scripts - closed source
I tried both running the bytecode (compiled script) you had attached and compiling it myself. Worked when I compiled it, but yours did not work for me.edit:
I compiled with the Win64 binaries, did you use the "test.out.txt" file. or compile it yourself first?
I tried using the Win32 binaries and it worked for me which is great.![]()
This is correct. You can include/dofile another Lua script whether or not it is also compiled or not. So, just don't compile the config file.I was curious about this so I tested it, using the include function, you can include un-compiled scripts, and it will compile them on-the-fly.
So you can have a main script that's compiled, and a config.lua that's uncompiled, then in the main file just call it like so:Code: Select all
include("config.lua");
The real reason I'm commenting on this is because the functionality of include() has recently changed (within the last few days). Previously, include() would include scripts based on a relative folder from the micromacro folder. Now, it will include scripts from your 'working path', relative direction to the working path, or from a full path. If this confuses you (and it probably will) [url=http://solarimpact.servegame.com/wiki/i ... ry#include]read all up on it in it's entry in the wiki[url].
Basically, you would previously need to do this:
Code: Select all
include("/scripts/myproject/functions.lua");
Code: Select all
include("functions.lua");
Who is online
Users browsing this forum: No registered users and 0 guests