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 that you accept 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: 190)
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
#10
(25.02.2016, 09:04)rocfusion Wrote: heres another one, http://www.tutorialspoint.com/lua/

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: https://www.youtube.com/watch?v=4NKMtazVNe8 He closed a few gaps which I didn't understand at the beginning of http://www.tutorialspoint.com/lua/ ...... 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.
Reply
#11
Hello,
I need use the goto statement for avoid to execute some commands.
How I can implement it?
Fabio
Reply
#12
Use Google as your best friend (:

http://lua-users.org/wiki/GotoStatement
Reply
#13
Thank you.

Fabio
Reply


Forum Jump: