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 ?