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
#1
Hi,

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

http://nova-fusion.com/2012/08/27/lua-fo...rs-part-1/


Thanks,


Roger
Reply
#2
Some more links and documents attached to read on this subject:

LUA Quick start-up guide: http://openrb.com/slides/lua/#/step-1
LUA in 15 minutes: http://tylerneylon.com/a/learn-lua/
Full LUA doc: http://www.lua.org/docs.html


Attached Files
.docx   LUA short manual.docx (Size: 498.27 KB / Downloads: 87)
Reply
#3
heres another one, http://www.tutorialspoint.com/lua/
Reply
#4
i've found some good tips for optimizing Lua programs:

https://www.lua.org/gems/sample.pdf
Done is better than perfect
Reply
#5
This guide is for standard Lua, where as LM uses LuaJIT which already does many optimizations when running the code.
Reply
#6
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
Reply
#7
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.
Reply
#8
Hi,
How can create a window pop-up in the crhome or firefox when one object active?
Thanks
Reply
#9
Please create a separate thread and explain in more detail.
Reply


Forum Jump: