Logic Machine Forum
Lua Essentials - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Lua Essentials (/showthread.php?tid=12)



Lua Essentials - rocfusion - 01.07.2015

Hi,

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

http://nova-fusion.com/2012/08/27/lua-for-programmers-part-1/


Thanks,


Roger


RE: Lua Essentials - edgars - 02.07.2015

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


RE: Lua Essentials - rocfusion - 25.02.2016

heres another one, http://www.tutorialspoint.com/lua/


RE: Lua Essentials - buuuudzik - 27.09.2018

i've found some good tips for optimizing Lua programs:

https://www.lua.org/gems/sample.pdf


RE: Lua Essentials - admin - 27.09.2018

This guide is for standard Lua, where as LM uses LuaJIT which already does many optimizations when running the code.


RE: Lua Essentials - buuuudzik - 27.09.2018

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.


RE: Lua Essentials - admin - 27.09.2018

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.


RE: Lua Essentials - rogerabit - 28.01.2019

Hi,
How can create a window pop-up in the crhome or firefox when one object active?
Thanks


RE: Lua Essentials - admin - 28.01.2019

Please create a separate thread and explain in more detail.


RE: Lua Essentials - Hugo - 14.09.2020

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


GOTO statement - fabiorusco - 08.05.2021

Hello,
I need use the goto statement for avoid to execute some commands.
How I can implement it?
Fabio


RE: Lua Essentials - Erwin van der Zwart - 09.05.2021

Use Google as your best friend (:

http://lua-users.org/wiki/GotoStatement


RE: Lua Essentials - fabiorusco - 09.05.2021

Thank you.

Fabio