Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- mine program
- by Big SHiny Toys
- ]]--
- local function getNumber(title)
- local nOut
- repeat
- write(title)
- nOut = tonumber(read())
- until nOut and nOut > 0
- return nOut
- end
- local ver = 0.9
- local tArgs = {...}
- print("\n ---- Basic miner ----\n\tby : BigSHinyToys\n\tver : "..tostring(ver).."\n")
- local depth = tArgs[1] and tonumber(tArgs[1]) or getNumber("Depth : ")
- local length = tArgs[2] and tonumber(tArgs[2]) or getNumber("Length : ")
- local width = tArgs[3] and tonumber(tArgs[3]) or getNumber("Width : ")
- turtle.turnLeft()
- local function force(dig,move,atk)
- turtle[dig]()
- while not turtle[move]() do
- turtle[move]()
- turtle[atk]()
- sleep(0.5)
- end
- end
- local right = true
- for z = 1,depth do
- force("digDown","down","attackDown")
- right = not right
- for y = 1,length do
- right = not right
- local _ = right and turtle.turnRight() or turtle.turnLeft()
- _ = y == 1 or force("dig","forward","attack")
- _ = right and turtle.turnRight() or turtle.turnLeft()
- for x = 1,width - 1 do
- force("dig","forward","attack")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement