compileing scripts
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

compileing scripts

Started by blackwings, 20 June, 2004, 20:02:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blackwings

I wonder if it's easy to complie lua scripts? I was thinking of comling some of my script so that my hub might get a little bit faster.


VidFamne

About precompiling scripts.
Its IMHO only when you read in the scripts its faster.
The script engine in ptokax will compile the script, when you start the script.
This is what I thought about it.
Correct me if I'm wrong :D

plop

#2
QuoteOriginally posted by VidFamne
About precompiling scripts.
Its IMHO only when you read in the scripts its faster.
The script engine in ptokax will compile the script, when you start the script.
This is what I thought about it.
Correct me if I'm wrong :D
ptokax (and same for everything else which uses lua scripts) do indeed compile them on start.
just by using a precompiler you get a bit more speed.
lua is a character interpred language, by precompiling you strip all the blanc spaces, this is what makes it faster.
but i bet wombat can explain it better.

the way 2 use it:
luac -o outputfilename.lua inputfilename.lua

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Corayzon

im not sure exactly what im asking, but ...

how would you go bout compiling scripts so there unreadable by hub owners using them?

and no, im not making cslave compiled, just wanted to know =]

noza

NotRabidWombat

#4
Compiling is the process of changing human readable code into machine code.

The luac man page answers your question best:
"The main advantages of pre-compiling chunks are: faster loading, protecting source code from user changes, and off-line syntax error detection."

Although, JenZen and I experimented with altering compiled lua and found it was fairly easy, even with the most basic knowledge of the lua opcodes.

The other two advantages are good for a hub loading many small scripts (that may restart scripts often) but there are few advantages for large scripts to compile. It's just a false sense of security. Besides, we've all seen what happens here when someone tries to take credit for someone else's work ;-)

An interesting tid bit of information, you can combine all compiled lua files into one large file by appending them to each other. I would assume that order matters. *edit* with scripts that load other scripts */edit*

Read more about luac here:
http://www.lua.org/manual/4.0/luac.html

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

NotRabidWombat

"how would you go bout compiling scripts so there unreadable by hub owners using them?"

Surprisingly, compiled lua is readable when put into opcodes (to a programmer). JenZen and I also searched for a method to encrypt the file and perform a checksum at the beginning, but gave up after determing there was no productive way to use such a feature.

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.


blackwings

#7
QuoteOriginally posted by plop
the way 2 use it:
luac -o outputfilename.lua inputfilename.lua

plop

And which program should I use?

And radical, I wanted to compile files, not decompile.


NotRabidWombat

luac.exe (Compiled from Lua 4.0x)

plop, is kind enough to host it

http://www.plop.nl/lua_tools/luac_4.0.zip

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

NotRabidWombat

Actually, I am incorrect.

I neglected what section this thread was in. If you are compiling for BCDC++ lua, you will want the luac binary from the lua website (ver 5.x).

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

blackwings

#10
QuoteOriginally posted by NotRabidWombat
Actually, I am incorrect.

I neglected what section this thread was in. If you are compiling for BCDC++ lua, you will want the luac binary from the lua website (ver 5.x).

-NotRabidWombat

No, I meant the script I use for my hub. Anyway, there are only two sections that fit to this thread, this section or the "Help with Scripts" section. But I happend to choose this section of those two.


SMF spam blocked by CleanTalk