Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- turtle stack transfer
- -- moves blocks from one side to the other (up, forward, down)
- local source = "up"
- local target = "forward"
- local overflow = ""
- local slot = 1
- function getSuck(dir)
- if dir == "up" then return turtle.suckUp
- elseif dir == "forward" then return turtle.suck
- elseif dir == "down" then return turtle.suckDown
- else
- print("Unknown Direction: " .. dir)
- exit()
- end
- end
- function getDrop(dir)
- if dir == "up" then return turtle.dropUp
- elseif dir == "forward" then return turtle.drop
- elseif dir == "down" then return turtle.dropDown
- else
- print("Unknown Direction: " .. dir)
- exit()
- end
- end
- sourceSuck = getSuck(source)
- targetDrop = getDrop(target)
- if overflow ~= "" then
- overflowSuck = getSuck(overflow)
- overflowDrop = getDrop(overflow)
- overflow = true
- else
- overflow = false
- end
- turtle.select(slot)
- while true do
- if turtle.getItemCount(slot) > 0 then targetDrop() end
- if overflow and turtle.getItemCount(slot) > 0 then overflowDrop() end
- if turtle.getItemCount(slot) == 0 then sourceSuck() end
- if overflow and turtle.getItemCount(slot) == 0 then overflowSuck() end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement