Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- initialisation ---
- print("Please put coal in slot 1 and torches in others slots")
- print("how long?")
- L = read()
- L = math.floor(tonumber(L)/5)
- print("how wide?")
- W = read()
- W = tonumber(W)
- slotbase = 2
- --- function ---
- function testSlot()
- while turtle.getItemCount(slotbase) == 0 do
- slotbase = slotbase +1
- if slotbase == 17 then slotbase = 2 end
- end
- function Job()
- for j = 1, W do
- for i = 1,L do
- if turtle.getItemCount(slotbase) == 0 then testSlot() end
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- if turtle.detectDown() == false then
- turtle.placeDown()
- end
- end
- for i = 1, L do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- end
- end
- function Fuel()
- if fuelLvL < 2*L*W+10 then
- turtle.select(1)
- if turtle.refuel() == false then
- print("Please, put fuel in slot 1")
- else
- turtle.refuel(5)
- Fuel()
- end
- else
- Job()
- end
- Fuel()
Add Comment
Please, Sign In to add comment