This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Lua Essentials

Found this essential guide for lua.  Useful to know...


Some more links and documents attached to read on this subject:

LUA Quick start-up guide:
LUA in 15 minutes:
Full LUA doc:

Attached Files
.docx   LUA short manual.docx (Size: 498.27 KB / Downloads: 122)
heres another one,
i've found some good tips for optimizing Lua programs:
Done is better than perfect
This guide is for standard Lua, where as LM uses LuaJIT which already does many optimizations when running the code.
FYes, but some of advices are very good also for JIT version E.g. using locals(also using local copy of  math.sin when using it in loop and modifying data model. Maybe this is for some advanced users intuitive but for sure for less of users. Also using simple for loop instead of in ipairs when you must optimize your script.
Done is better than perfect
There's no difference in using math.sin directly or caching it via local variable in LuaJIT. Both examples take the same amount of time to run. And there are not many scripts that need to calculate sine 1000000 times in a row Smile

But, using local variables is a very good advice to avoid problems where some function overwrites a global variable with the same name and causes script errors.
How can create a window pop-up in the crhome or firefox when one object active?
Please create a separate thread and explain in more detail.
(25.02.2016, 09:04)rocfusion Wrote: heres another one,

Thank you. This is probably the long time wanted entrance for "lua beginners"  "without programming knowledge".

Addendum 09/15/2020: This young man is also very helpful: He closed a few gaps which I didn't understand at the beginning of ...... Maybe I'll understand that one day or I give up as I did with my hanging man game on qBasic/dos 5.0 28 years ago.

Forum Jump: