SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("predictPath.lua")
| |
| 2 | os.loadAPI("turtleToCords.lua")
| |
| 3 | os.loadAPI("userInput.lua")
| |
| 4 | os.loadAPI("getTurtleFuel.lua")
| |
| 5 | ||
| 6 | - | function getLocation() |
| 6 | + | cx, cy, cz = gps.locate() |
| 7 | - | --must be started with pick equipped and modem in first slot |
| 7 | + | tx = tonumber(userInput.getUserInput("X Cord: "))
|
| 8 | - | x = tonumber(userInput.getUserInput("X Cord: "))
|
| 8 | + | ty = tonumber(userInput.getUserInput("Y Cord: "))
|
| 9 | - | y = tonumber(userInput.getUserInput("Y Cord: "))
|
| 9 | + | tz = tonumber(userInput.getUserInput("Z Cord: "))
|
| 10 | - | z = tonumber(userInput.getUserInput("Z Cord: "))
|
| 10 | + | |
| 11 | - | return x, y, z |
| 11 | + | |
| 12 | predictPath.predictTwo(x, y, z, cx, cy, cz) | |
| 13 | ||
| 14 | - | function goToCords(x, y, z) |
| 14 | + | fuelcost = predictPath.getFuelCost() |
| 15 | - | path = {1}
|
| 15 | + | if fuelcost > turtle.getFuelLevel() then |
| 16 | - | predictPath.predict(x, y, z, path) |
| 16 | + | getTurtleFuel.displayFuelInfo() |
| 17 | - | predictPath.finalWrite(predictPath.getPath()) |
| 17 | + | print("Fuel too Low to Start, Please Insert Buckets")
|
| 18 | - | fuelcost = predictPath.getFuelCost() |
| 18 | + | userInput.getUserInput("Type Anything to Refuel")
|
| 19 | - | if fuelcost > turtle.getFuelLevel() then |
| 19 | + | shell.run("turtleRefuel.lua")
|
| 20 | - | getTurtleFuel.displayFuelInfo() |
| 20 | + | |
| 21 | - | print("Fuel Needed: " .. fuelcost)
|
| 21 | + | if fuelcost > turtle.getFuelLevel() then |
| 22 | - | print("Fuel too Low to Start, Please Insert Buckets")
|
| 22 | + | print("Fuel Still too Low to Start, Terminating Program")
|
| 23 | - | userInput.getUserInput("Type Anything to Refuel")
|
| 23 | + | else |
| 24 | - | shell.run("turtleRefuel.lua")
|
| 24 | + | turtleToCords.toCords(x, y, z) |
| 25 | - | end |
| 25 | + |