Advertisement
CelticCoder

turtleOneTrip

May 12th, 2024 (edited)
73
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.  
  7. --must be started with pick equipped and modem in first slot
  8.  
  9. function oneTrip(x, y, z)
  10.     path = {1}
  11.     predictPath.resetFuelCost()
  12.     predictPath.predict(x, y, z, path)
  13.     predictPath.finalWrite(predictPath.getPath())
  14.     fuelcost = predictPath.getFuelCost()
  15.     if fuelcost > turtle.getFuelLevel() then
  16.         getTurtleFuel.displayFuelInfo()
  17.         print("Fuel Needed: " .. fuelcost)
  18.         print("Fuel too Low to Start, Please Insert Buckets")
  19.         return false
  20.     end
  21.         turtleToCords.toCords(predictPath.getDiffX(), predictPath.getDiffY(), predictPath.getDiffZ(), predictPath.getNegX(),    predictPath.getNegY(), predictPath.getNegZ())
  22.         return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement