Advertisement
CelticCoder

turtleManualRoundTrip

Nov 13th, 2023 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("predictPath.lua")
  2. os.loadAPI("turtleToCords.lua")
  3. os.loadAPI("userInput.lua")
  4. os.loadAPI("getTurtleFuel.lua")
  5.  
  6. --must be started with pick equipped and modem in first slot
  7. turtle.equipLeft()
  8. cx, cy, cz = gps.locate()
  9. turtle.equipLeft()
  10. x = tonumber(userInput.getUserInput("X Cord: "))
  11. y = tonumber(userInput.getUserInput("Y Cord: "))
  12. z = tonumber(userInput.getUserInput("Z Cord: "))
  13.  
  14. path = {1}
  15. predictPath.predictTwo(x, y, z, cx, cy, cz, path)
  16. predictPath.finalWrite(predictPath.getPath())
  17. fuelcost = predictPath.getFuelCost()
  18. if fuelcost > turtle.getFuelLevel() then
  19.     getTurtleFuel.displayFuelInfo()
  20.     print("Fuel Needed: " .. fuelcost)
  21.     print("Fuel too Low to Start, Please Insert Buckets")
  22.     userInput.getUserInput("Type Anything to Refuel")
  23.     shell.run("turtleRefuel.lua")
  24. end
  25. if fuelcost > turtle.getFuelLevel() then
  26.     print("Fuel Still too Low to Start, Terminating Program")
  27. else
  28.     predictPath.predict(x, y, z)
  29.     turtleToCords.toCords(predictPath.getDiffX(), predictPath.getDiffY(), predictPath.getDiffZ(), predictPath.getNegX(), predictPath.getNegY(), predictPath.getNegZ())
  30.     predictPath.predict(cx, cy, cz)
  31.     turtleToCords.toCords(predictPath.getDiffX(), predictPath.getDiffY(), predictPath.getDiffZ(), predictPath.getNegX(), predictPath.getNegY(), predictPath.getNegZ())
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement