Posted 04 September 2013 - 12:42 AM
I know he has his stuff set up great, but I'm running the ultimate mod pack and not his. Makes things a little tougher to get. anyway heres the code
local location = ""
function teleport()
tp = peripheral.wrap("bottom")
tp.teleport()
end
function checkFull()
greader = peripheral.wrap("right")
data = greader.get()
while not data["Full Energy"] do
sleep(2)
data=greader.get()
end
turtle.dig()
end
function checkEmpty()
greader=peripheral.wrap("right")
data = greader.get()
while not data["No Energy"] do
sleep(2)
data = greader.get()
end
turtle.dig()
end
function checkLoc()
loc = turtle.detectUp()
if loc == true then
print("I am at the quarry")
location = "Quarry"
if turtle.getItemCount(1) > 0 then turtle.turnRight() end
else
print("I am at the charge station")
location = "Charging"
if turtle.getItemCount(1) > 0 then
turtle.turnRight()
turtle.forward()
turtle.forward()
end
end
end
function getFuel()
turtle.turnleft()
for i = 1, 8 do turtle.forward() end
turtle.turnLeft()
for i = 1, 2 do turtle.forward() end
turtle.suck()
turtle.refuel()
turtle.turnLeft()
turtle.turnLeft()
for i = 1, 2 do turtle.forward() end
turtle.turnRight()
for i = 1, 8 do turtle.forward() end
turtle.turnleft()
end
function checkFuel()
fuel = turtle.getFuelLevel()
print("My fuel level:"..tostring(fuel))
if fuel < 1000 then
print("I need fuel")
getFuel()
print("My fuel level:"..tostring(turtle.getFuelLevel()))
end
end
checkLoc()
if location == "Quarry" then
turtle.place()
checkEmpty()
teleport()
else
turtle.place()
checkFuel()
checkFull()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.forward()
teleport()
end
i get…bios :338: [string "teleport"]:8: '='
expected
local location = ""
function teleport()
tp = peripheral.wrap("bottom")
tp.teleport()
end
function checkFull()
greader = peripheral.wrap("right")
data = greader.get()
while not data["Full Energy"] do
sleep(2)
data=greader.get()
end
turtle.dig()
end
function checkEmpty()
greader=peripheral.wrap("right")
data = greader.get()
while not data["No Energy"] do
sleep(2)
data = greader.get()
end
turtle.dig()
end
function checkLoc()
loc = turtle.detectUp()
if loc == true then
print("I am at the quarry")
location = "Quarry"
if turtle.getItemCount(1) > 0 then turtle.turnRight() end
else
print("I am at the charge station")
location = "Charging"
if turtle.getItemCount(1) > 0 then
turtle.turnRight()
turtle.forward()
turtle.forward()
end
end
end
function getFuel()
turtle.turnleft()
for i = 1, 8 do turtle.forward() end
turtle.turnLeft()
for i = 1, 2 do turtle.forward() end
turtle.suck()
turtle.refuel()
turtle.turnLeft()
turtle.turnLeft()
for i = 1, 2 do turtle.forward() end
turtle.turnRight()
for i = 1, 8 do turtle.forward() end
turtle.turnleft()
end
function checkFuel()
fuel = turtle.getFuelLevel()
print("My fuel level:"..tostring(fuel))
if fuel < 1000 then
print("I need fuel")
getFuel()
print("My fuel level:"..tostring(turtle.getFuelLevel()))
end
end
checkLoc()
if location == "Quarry" then
turtle.place()
checkEmpty()
teleport()
else
turtle.place()
checkFuel()
checkFull()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.forward()
teleport()
end
i get…bios :338: [string "teleport"]:8: '='
expected