<big>Autohook</big>

Status: $AUTOHOOK_ENABLED$

When autohook is enabled, when a luacontroller takes too much time to execute before yielding, instead of throwing an error, the debug hook will instead yield.

Meaning in practice, that you don't have to have pointless <mono>wait(0)</mono> calls anymore, as autohook will simply yield automatically.

<b>(small) Downsides<b>
Given that you cannot control where the debug hook yields, it may attempt to yield in places it can't, resulting in a <mono>attempt to yield across C-call boundary</mono>
To solve this, after the time limit has passed, your code is internally given 10 "chances" to get in a state that is yieldable. If not, it will just yield anyway. So this error should be very rare unless you are intentionally trying to get it.
You cannot yield in places such as <mono>return x, y, z</mono> or <mono>table.sort(x, function() ... end)</mono>

Also, autohook works only with luajit, but this isn't a problem as skyblock zero requires luajit to run anyway (what 99.9% of people have).


<big>How do i enable it? (For server admins/singleplayer world owners)</big>

Requires:
- Basic knowledge of how to use a terminal
- A GNU/Linux system (figure it out if you are on windows)

1) Add sbz_logic_autohook to your trusted mods. 
2) Compile autohook (navigate to <.minetest>/games/skyblock_zero/sbz_logic_autohook, run `make clean all`)