Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- os.loadAPI("theinsekt/mineVein")
- os.loadAPI("theinsekt/mine2")
- if #args~=2 then
- print("Usage: mineMaterials <dir> <limit>")
- return
- end
- local slots=mineVein.slotsA()
- local dir=args[1]
- local limit=tonumber(args[2])
- local noReturn="Blocked when trying to return."
- local noMaterial="No material in first inventory slot, so trying to mine material in direction."
- if #slots==0 then
- print(noMaterial)
- if mine2.digLoop(dir,1)~=1 then
- print("Blocked!")
- print("finished")
- return
- end
- slots=mineVein.slotsA()
- if #slots==0 then
- print("Found no material in direction.")
- if mine2.digLoop(dir,-1)~=-1 then
- print(noReturn)
- else
- print("finished")
- end
- return
- end
- if mineVein.mineVeinR(slots, true,limit) then
- if mine2.digLoop(dir,-1)==-1 then
- print("finished")
- return
- end
- end
- print(noReturn)
- return
- end
- if mineVein.mineVein(dir,slots,true,limit) then
- print("finished")
- else
- print(noReturn)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement