![]() |
[TOOL] LUAC Script Compiler
1 Attachment(s)
A LUA compiler written in LUA. This application will only work within the simulator, and it's only meant to.
LUAC gives you a list of the applications in your applications folder used by the simulator. Click on one and it will compile the MAIN.LUA script. It will create a backup named MAIN.BAK.LUA. Updated to compile all LUA files in the selected application folder(Not sub-folders though, maybe later). Example: All lua files in C:\Creative\ZEN X-Fi2\Applications\MyGame\ http://img194.imageshack.us/img194/8161/95984862.png |
Awesome tool, I can see this coming in handy.
|
Indeed. I wrote my own little script to do it after your instructions, but this one requires less work ^^
|
Updated to compile all LUA files in the application folder(Not sub-folders though, maybe later).
|
After compiling a file, is it still possible to have it written to by another Lua file? (io.output)
|
Quote:
And I also wonder like Tetrajak, if it compiles the "stat.lua" where I save stuff, will I be able to read and write to it? |
Quote:
Quote:
|
Quote:
|
Does compiling scripts help to save memory? I have problem, that i am running out of memory in my app hypogeum.
|
It only helps with startup, because the code will compile on runtime anyway.
|
It did help. Starting Hypogeum on player with scripts compiled doesn't crash the app.
I have 1 suggestion how to make LUAC more user friendly: don't compile scripts to script.lua.COMP because if you have 20+ script you have to manually remane them back every time you compile them :( - you could back em up to folder - remane the backup rather then compiled scripts. |
Quote:
Code:
function compile(file) -- this function will compile a file |
Quote:
But, there is one flaw with doing it this way. If you compile the app twice, then it backs up your already compiled file, overwriting the uncompiled backup. That is why he did it the way he did I assume. I will look into it a bit more to see if I can come up with a viable solution to prevent this from happening, I've got an idea... |
Quote:
It is a c module that you can use once compiled using the require function "require lfs" then you can handle directories ( here is an example), Code:
for file in lfs.dir[[C:\Program Files]] do |
Quote:
On another note, fixed the over-writing bug so now if I could just make these folders work then I can upload it... |
1 Attachment(s)
Quote:
The dll will be in the attachments of this post extract the dll to the root folder of the lua code and use ' require "lfs" ' to load it ------------------------------------------------------------------------------------------------------------------------------------------ This dll was built for a specific setup using some other dll's so it will crash, i will resetup the dll and the package and uploaded it again soon -------------------------------------------------------------------- Its all working now, i re uploaded the zip |
Ah, thanks! I haven't used modules for LUA before, and I wasn't sure exactly what I'd need, and I wasn't sure how to compile it myself just right off the bat. I'm spoiled with Visual Studio and Eclipse... xD
|
Make sure you re download the zip, i changed the setup so it wont crash,
Sample code: Code:
require "lfs" |
I made it work by downloading and including the missing .dll, but thanks for the fix. I found that reference already as well online. Now my only issue is that it creates the folder, but I can't write to it, it says it doesn't exist, can't figure out why... Guess I need to head to bed soon, it's getting late. Thanks for the help! I'll hopefully have it working by tomorrow.
|
Quote:
Code:
require "lfs" |
| All times are GMT -5. The time now is 08:42 AM. |