-- download at MT.QZX.COM (refill-single-ore-spawner.lua) if not a then a="N" -- tunnel direction: N S E W f="default:gold_ingot" -- spawner fuel -- DON'T TOUCH ANYTHING BELOW HERE fs = string.len(f)+2 as={["N"]=0,["W"]=90,["S"]=180,["E"]=270} ; turn.angle(as[a]) for i = 1,3 do local item = check_inventory.up("", "main", i) if not take.up(item) then break end end else local function get_count() local i = check_inventory.forward("", "fuel", 1) if i == "" or i == nil then return 99 end local c = string.sub(i, fs) if c == "" or c == nil then c = 1 end return 99 - tonumber(c) end local c = get_count() if c > 0 then if not insert.forward(string.concat({f, " ", c}), "fuel") then insert.forward(f, "fuel") end end self.remove() end