Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = peripheral.wrap("top")
- m = peripheral.wrap("right")
- function fillGold()
- turtle.turnRight()
- turtle.forward()
- turtle.select(1)
- turtle.drop()
- turtle.back()
- turtle.turnLeft()
- end
- function fillGlass()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(4)
- turtle.drop()
- turtle.back()
- turtle.turnRight()
- end
- function fillBrass()
- turtle.turnRight()
- turtle.forward()
- turtle.select(2)
- turtle.drop()
- turtle.select(3)
- turtle.drop()
- turtle.back()
- turtle.turnLeft()
- end
- while true do
- next = true
- i = 1
- gold = 0
- brass = 0
- glass = 0
- fuel = false
- if turtle.getFuelLevel() < 5000 then
- rs.setOutput("front",true)
- os.sleep(0.5)
- rs.setOutput("front",false)
- fuel = true
- end
- while next do
- table = c.getStackInSlot(i)
- if table.qty == nil then
- next = false
- else
- if table.id == 12 then
- glass = tonumber(table.qty)
- turtle.select(4)
- elseif table.id == 9589 then
- turtle.select(3)
- elseif table.id == 20264 then
- brass = (tonumber(table.qty)*4)
- turtle.select(2)
- elseif table.id == 266 then
- gold = (tonumber(table.qty)/2)
- turtle.select(1)
- elseif table.id == 263 then
- turtle.select(5)
- end
- c.swapStacks(i,1)
- turtle.suckUp()
- end
- if gold > 0 then
- m.transmit(500,501,gold)
- end
- if brass > 0 then
- m.transmit(502,501,brass)
- end
- if glass > 0 then
- m.transmit(504,501,glass)
- end
- i = i + 1
- end
- if fuel then
- turtle.select(5)
- turtle.refuel()
- end
- if (gold+brass+glass) > 0 then
- for i = 1, 3 do
- turtle.down()
- end
- turtle.forward()
- turtle.forward()
- if gold > 0 then
- fillGold()
- end
- if glass > 0 then
- fillGlass()
- end
- if brass > 0 then -- Bij 4de smeltery dit uitbreiden
- for i = 1, 7 do
- turtle.forward()
- end
- if brass > 0 then
- fillBrass()
- end
- for i = 1, 7 do
- turtle.back()
- end
- end
- turtle.back()
- turtle.back()
- for i = 1, 3 do
- turtle.up()
- end
- end
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement