LuaCombinator 3 deprecated

by OwnlyMe

Like LuaCombinator2, but with full event support

Content
4 years ago
0.17 - 0.18
34
Circuit network

g Error message when loading, need to OK to run

4 years ago

Hi,'
Experimenting with lua combinator.
Have this script, that runs OK when started .


local v1 = 0
local v2 = 0
local v4 = 0
on_tick = function(event)
v1 = v1 +1
v2 = v2 + (rednet['copper-ore'] or 0)
v4 = v4 + (rednet['copper-ore'] or 0)
if v1 > 60 then
v3 = v2
v1 = 0
v2 = 0
output['iron-ore'] = v3
output['coal'] = v4
end
end


But when I load the save-file I get the message Attempt to perform arithmetic error on upvalue v1 ( a nilvalue)
After I open the combinator and push OK, it runs fine again.

Is there an additional step/initialization I need to do ?

4 years ago
(updated 4 years ago)

local variables expire after execution
you should store your stuff in the var[] table

New response