Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = nil
- local args = {...}
- x = toNumber(args[0])
- y = toNumber(args[1])
- print("Doing a " ..x .." by " ..y)
- function calcFuel()
- local fuel = (x*y)+y
- local hasFuel = false
- while not hasFuel do
- if turtle.getFuelLevel() < fuel then
- print("Fuel is to low to do that! Please give me more Fuel!")
- print("Insert Fuel and wait 5 secs!")
- sleep(5)
- local i
- for i = 1, 16 do
- turtle.select(i)
- turtle.refuel()
- i=i+1
- end
- turtle.select(1)
- else
- print("Got enough fuel for that!")
- turtle.select(1)
- end
- end
- end
- function tryForward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function goPlace()
- turtle.placeDown()
- tryForward()
- end
- function collum()
- local i = 0
- while i<x do
- goPlace()
- i=i+1
- end
- end
- function rows()
- local j = 1
- local turn = false
- while j < y do
- collum()
- if turn then
- turtle.turnLeft()
- tryForward()
- turtle.turtle.turnLeft()
- else
- turtle.turnRight()
- tryForward()
- turtle.turnRight()
- end
- j=j+1
- end
- end
- calcFuel()
- turtle.turnLeft()
- rows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement