Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("predictPath.lua")
- os.loadAPI("turtleToCords.lua")
- os.loadAPI("userInput.lua")
- os.loadAPI("getTurtleFuel.lua")
- function getLocation()
- --must be started with pick equipped and modem in first slot
- x = tonumber(userInput.getUserInput("X Cord: "))
- y = tonumber(userInput.getUserInput("Y Cord: "))
- z = tonumber(userInput.getUserInput("Z Cord: "))
- return x, y, z
- end
- function goToCords(x, y, z)
- path = {1}
- predictPath.predict(x, y, z, path)
- predictPath.finalWrite(predictPath.getPath())
- fuelcost = predictPath.getFuelCost()
- if fuelcost > turtle.getFuelLevel() then
- getTurtleFuel.displayFuelInfo()
- print("Fuel Needed: " .. fuelcost)
- print("Fuel too Low to Start, Please Insert Buckets")
- userInput.getUserInput("Type Anything to Refuel")
- shell.run("turtleRefuel.lua")
- end
- if fuelcost > turtle.getFuelLevel() then
- print("Fuel Still too Low to Start, Terminating Program")
- else
- turtleToCords.toCords(predictPath.getDiffX(), predictPath.getDiffY(), predictPath.getDiffZ(), predictPath.getNegX(), predictPath.getNegY(), predictPath.getNegZ())
- end
- end
- function goToCordsMine(x, y, z)
- path = {1}
- predictPath.predictMine(x, y, z, path)
- predictPath.finalWrite(predictPath.getPath())
- fuelcost = predictPath.getFuelCost()
- if fuelcost > turtle.getFuelLevel() then
- getTurtleFuel.displayFuelInfo()
- print("Fuel Needed: " .. fuelcost)
- print("Fuel too Low to Start, Please Insert Buckets")
- userInput.getUserInput("Type Anything to Refuel")
- shell.run("turtleRefuel.lua")
- end
- if fuelcost > turtle.getFuelLevel() then
- print("Fuel Still too Low to Start, Terminating Program")
- else
- turtleToCords.toCordsMine(predictPath.getDiffX(), predictPath.getDiffY(), predictPath.getDiffZ(), predictPath.getNegX(), predictPath.getNegY(), predictPath.getNegZ())
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement