Created
June 2, 2019 16:02
Use interrupt to create a delay in Minetest Luacontrollers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local delay = 1 | |
if event.type == 'program' then | |
interrupt( delay, 'Once' ) | |
interrupt( delay, 'Loop' ) | |
end | |
if event.type == 'interrupt' then | |
if event.iid == 'Once' then | |
print( 'Run once' ) | |
elseif event.iid == 'Loop' then | |
print( 'over and over' ) | |
interrupt( delay, 'Loop' ) | |
end | |
end |
yea, it was to illustrate the difference between those two methods to somebody on Discord. They were having the same issue; having it loop then overheat, when it should have only run once.
That would depend on your server and your uses. Try increasing the delay to reduce the chance of it happening. Otherwise, rebuild machine, or tweak server settings.
I found out that an activated modlib causes the overheating.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example causes an overheat after a few seconds.