<bigger> Luacontroller Basics </bigger>
Luacontrollers execute <big>SANDBOXED and LIMITED</big> lua code, they can be used for controlling machines or logic devices.

Skyblock Zero's luacontrollers are <b>EXTREMELY</b> different than mesecon's luacontrollers. (But everything possible with mesecon's luacontrollers is possible with skyblock zero's luacontrollers)

If you are not familiar with lua, then uhh... you will need to learn it i guess?
If you are familiar with like any other programming language, it shouldn't be difficult (just experiment with the examples, then do a couple of "Lua for loop how to" searches, no need for a 5 hour long in-depth tutorial video). Don't worry it's no rust.
Also keep in mind that minetest is using luajit. (Almost the same as lua5.1, anything that works on lua5.1 *should* work on luajit.) 

So... how do you actually use a luacontroller...

By default, even when connected to power, it doesn't do anything....
To actually be able to use the luacontroller (well, for the first time anyway), you need to get the editor system disk.  (by just crafting it)

If you click the luacontroller with the editor system disk (will be reffered to as "punching editor" [code] here), it will deploy the disk's editor code to the luacontroller,
so if you right click the luacontroller, an editor should appear.

If there are any errors in the <b>editor</b> code, they will be displayed in the infotext (infotext is that text that appears when you hover a block).
But if there are any errors in the <b>main</b> code, they should be displayed by the editor.

Now... what's the difference between editor and main code...
Editor code - Code that's responsible for the editor, runs differently than main code but i won't get into that just now...
Main code - Code that actually does the thing you want to achieve with the luacontroller

<bigger>Compute Limits</bigger>

To not cause any harm to the server, or accidental infinite loops, the execution *time* of the luacontroller is limited.

The editor is limited to $EDITOR_MS_LIMIT$ miliseconds per event (such as clicking).
The main code is limited to $MAIN_MS_LIMIT$ miliseconds without yielding.
There is no hard cap on how many events per second you can have, but instead miliseconds used per second.
So if main code and editor take up more than $COMBINED_MS_LIMIT$ miliseconds, per second, the sandbox won't be able to receive events (including editor) until the next second passes. (And the probably very high bill gets paid.)

Also, for each milisecond you take, you get billed 4 power. If you consumed too much, the luacontroller (including editor) won't function until the bill is paid.

<bigger>Main Code</bigger>

So, if you are used to the mesecons luacontroller, temporarily forget *everything* about how the code is executed, this is <b>very</b> different.

The main code gets executed inside a coroutine, and you can *yield* it, in fact that is how you obtain events.
so <mono>event = yield(...)</mono>

You can yield <big>ANYWHERE*!!</big>
Example: <mono>
$C1i = 0
$C1local function yield_if_needed()
$C1    i = i + 1
$C1    if i == 5 then
$C1        _missed_events = wait(0.1) -- this function internally calls yield, ill go over it later.
$C1        i = 0
$C1    end
$C1end
$C1
$C1for x = 1,100 do
$C1    for y = 1,100 do
$C1        for z = 1,100 do
$C1            yield_if_needed() -- pauses the sandbox so we don't time out
$C1            do_some_complex_stuff_idk_have_fun()
$C1        end
$C1    end
$C1end
</mono>

*with luajit, PUC lua is not supported

It is turned on/off by the editor, or turned on by a <mono>send</mono> event

You can have up to $MAIN_RAM_LIMIT$ MEGABYTE(S) in the environment (though that also includes all the mounted disks), it weighs all locals, functions, their upvalues, their locals, their functions... IF libox is included in the trusted mods setting. (If it isn't and it's a server that's a serious vurnability.)

Only disks and mem get saved though.

<bigger>Editor Code</bigger>

Code that's responsible for the... editor...
Executes VERY similarly to the mesecons luacontroller

Only contains a very basic environment, but once the main sandbox is on, it can access that environment directly.

As mentioned earlier, if there is an error with the editor code, it ends up in the infotext.
Both editor and main sandbox receive gui events.

<bigger>Linking</bigger>

Linking range = The radius of the square that you see when you wield the luacontroller linking tool (with the luacontroller linking tool being linked to a luacontroller)
Linking range is usually enforced for doing anything that's in the world (like sending information or getting a node)
To increase linking range (by default 0, so the luacontroller basically can't do anything), you will need to upgrade the luacontroller with a Linking Upgrade.
