Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 3 then
- print("Usage: mine <length> <width> <depth>")
- return
- end
- local function move(x,y)
- shell.run("move",x,y)
- end
- local function status(x,y,z,depth,width,length)
- print("x="..x.." y="..y.." z="..z.." depth="..depth.." length="..length.." width="..width)
- end
- local length = tArgs[1] - 1
- local width = tArgs[2]
- local depth = tArgs[3]
- local distance = tArgs[1] + tArgs[2] + tArgs[3]
- local x=0
- local y=0
- local z=0
- for z=1,depth do
- for x=1,width do
- for y=1,length do
- status(x,y,z,depth,width,length)
- turtle.dig()
- move("f","1")
- sleep(.1)
- end
- status(x,y,z,length,width,depth)
- d=bit.band(x,1)
- if x == a then
- print("x=a")
- else
- if d==0 then
- print("x does not equal width")
- status(x,y,z,length,width,depth)
- move("l","0")
- turtle.dig()
- move("f","1")
- move("l","0")
- elseif d==1 then
- move("r","0")
- turtle.dig()
- move("f","1")
- move("r","0")
- else
- move("f","0")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement