newbie question about lua scripting
 

newbie question about lua scripting

Started by Devongrrl, 12 December, 2004, 14:54:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Devongrrl

i understand that lua scripts are compiled

where can i get source code from to see how to modify scripts

i have done a little C++ and lots of vb and VBS before

??????Hawk??????

hi  

you can only get the source  if the  Creator decides to give it out  ...

Devongrrl

#2
Perhaps I asked the wrong questions ?(  !

Once I have created my script how do or what should i use to complie it into a lua file ?


enema

you can create txt file and just change its extension to lua or use ptokaX (script editor)

plop

QuoteOriginally posted by Devongrrl
Perhaps I asked the wrong questions ?(  !

Once I have created my script how do or what should i use to complie it into a lua file ?


lua is a scripting language, this means there is no need 2 compile it like c++.
a script is nothing more then a text file.
but there is a small difference between lua and other scripting languages.
normaly scripting languages interpret a script character by character, every space is interpretted but this means it wastes time.
lua compiles the script the moment it loads it, the result gives more speed (it removes all unneeded spaces for example).
but what about those compilers some ppl use you might ask now, those compilers are pre-compilers.
this gives between 25-50% extra speed.
you can find sutch a pre-compiler for lua on my website.
the way 2 use it is simple.
luac -o

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 <----<<

Typhoon

plop, isn't it only at first script load  it really takes advantage of the precompilers like "luac",  hope you understand my point :o)


Typhoon?



plop

QuoteOriginally posted by Typhoon?
plop, isn't it only at first script load  it really takes advantage of the precompilers like "luac",  hope you understand my point :o)


Typhoon?
yep on loading lua compiles them, using a pre-compiler makes lua's own compiler more efficient.

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 <----<<

Typhoon

okay , but still only at first load ? , or when compiled it works faster when running constant and not only at first load  ? ...


Typhoon?



plop

QuoteOriginally posted by Typhoon?
okay , but still only at first load ? , or when compiled it works faster when running constant and not only at first load  ? ...


Typhoon?
it makes the compiler more efficient so you get a more optimized script.
which runs faster all the time.

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 <----<<

VidFamne

hmm
QuoteThe main advantages of precompiling chunks are: faster loading, protecting source code from user changes, and off-line syntax checking.

Pre-compiling does not imply faster execution because in Lua chunks are always compiled into bytecodes before being executed. luac simply allows those bytecodes to be saved in a file for later execution
 
found this on Luac's man page  >>HERE<<

SMF spam blocked by CleanTalk