Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slot = 1
- function getSlot()
- while turtle.getItemCount(slot) == 0 and slot < 16 do
- slot = slot + 1
- end
- if turtle.getItemCount(slot) == 0 and slot == 16 then
- print("No more ressources... Fill me up and press enter")
- read()
- slot = 1
- end
- end
- local args = { ... }
- if #args < 1 then
- print("")
- print("Usage: bridge <length> <buildSides 0|1>")
- print("")
- error()
- end
- if #args >= 1 then
- length = tonumber(args[1])
- sides = 0
- end
- if #args >= 2 then
- length = tonumber(args[1])
- sides = tonumber(args[2])
- end
- if turtle.getFuelLevel() < length then
- print("I need " .. length - turtle.getFuelLevel() .. " more fuel!")
- else
- print("======== 2019 (c) psychedelixx ========")
- print("Let's go!")
- while length > 0 do
- print("Remaining: " .. length)
- t.dig()
- t.forward()
- t.placeDown(slot)
- getSlot()
- if sides == 1 then
- t.placeLeft(slot)
- getSlot()
- t.placeRight(slot)
- getSlot()
- end
- length = length - 1
- end
- t.place(slot)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement