Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("turtleManualOneTrip.lua")
- --start with pick in left and geoscanner in right of turtle, and modem in first slot
- function scan()
- scanner = peripheral.wrap("right")
- if scanner.cost(15) > scanner.getFuelLevel() then
- print("Not Enough Fuel")
- print("Cost: " .. scanner.cost(15))
- print("Fuel Level: " .. scanner.getFuelLevel() .. "/" .. scanner.getMaxFuelLevel())
- os.exit(1)
- end
- turtle.equipRight()
- rednet.open("right")
- cx, cy, cz = gps.locate()
- if cx == nil and cy == nil and cz == nil then
- print("GPS Error")
- os.exit(1)
- end
- turtle.equipRight()
- if not item and choice == 2 then
- print("No Name Inputted")
- os.exit(1)
- end
- return scanner.scan(15)
- end
- function geoMineItem(item)
- blocks = scan()
- if blocks ~= nil then
- for _, block in pairs(blocks) do
- if block.name == item then
- x = cx + block.x
- y = cy + (block.y + 1)
- z = cz + block.z
- turtleManualOneTrip.goToCordsMine(x, y, z)
- end
- end
- turtleManualOneTrip.goToCordsMine(cx, cy, cz)
- else
- print("Couldnt Scan")
- end
- end
- function geoMineList(itemlist)
- if itemlist ~= nil then
- blocks = scan()
- else
- print("Itemlist no found")
- os.exit(1)
- end
- if blocks ~= nil and itemlist ~= nil then
- for _, block in pairs(blocks) do
- for _, item in pairs(itemlist) do
- if block.name == item then
- x = cx + block.x
- y = cy + (block.y + 1)
- z = cz + block.z
- turtleManualOneTrip.goToCordsMine(x, y, z)
- end
- end
- end
- turtleManualOneTrip.goToCordsMine(cx, cy, cz)
- elseif blocks == nil then
- print("Couldnt Scan")
- elseif itemlist == nil then
- print("Itemlist no found")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement