Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- refuel=function()
- if turtle.getFuelLevel() ~= "unlimited" then
- for n=1,16 do
- nCount = turtle.getItemCount(n)
- if nCount > 0 then
- turtle.select( n )
- if nCount >= nLimit then
- if turtle.refuel( nLimit ) then
- break
- end
- else
- if turtle.refuel( nCount ) then
- nLimit = nLimit - nCount
- end
- end
- end
- end
- end
- end
- local pArgs = { ... }
- local dlina = tonumber( pArgs[1] )
- local shirina = tonumber( pArgs[2] )
- local conUD = pArgs[3]
- local ConTurn = pArgs[4]
- if pArgs[1]==null then
- print("Dlina(vperod)(1>): ")
- dlina = tonumber(read())
- print("Shirina (1>): ")
- shirina = tonumber(read())
- print("Up/Down mod (u/d): ")
- conUD= read()
- print("Left or Right? (l/r): ")
- ConTurn = read()
- end
- if dlina == null then
- dlina = 3
- end
- if shirina==null then
- shirina=3
- end
- if conUD~=u then
- if conUD~=d then
- conUD=u
- end
- end
- if ConTurn~=l then
- if ConTurn~=r then
- ConTurn=l
- end
- end
- while true do
- for 1, shirina do
- for 1,dlina do
- if conUD==u then
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- if conUD==d then
- if turtle.detectDown() then
- turtle.digDown()
- end
- end
- if turtle.detect() then
- turtle.dig()
- end
- if turtle.getFuelLevel()==0 then
- refuel(1)
- end
- turtle.forward()
- end
- if ConTurn==l then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- if ConTurn==r then
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment