Posted 11 June 2013 - 04:45 PM
--My Second Code
--To use put this code in startup on the turtle
--Dont Edit anything unless your inproving the code
--This Is Sloppy I Know But Im New
--This Code Goes In The Turtle, and in a file called startup
--Use f, b, l, r, to drive it but you type: f, hit enter to go forward
-- f is forward, b is back, l is left, r is right.
yes = turtle.refuel(1)
fuel = turtle.getFuelLevel()
f = turtle.forward()
b = turtle.back()
l = turtle.turnLeft()
r = turtle.turnRight()
textutils.slowPrint("Checking Fuel...")
sleep(6)
turtle.getFuelLevel()
sleep(4)
textutils.slowPrint("Fuel Level: "..fuel.."")
write("Want To Refuel Turtle?: ")
Refuelturtle = read()
if Refuelturtle == (yes) then
textutils.slowPrint("Refueling Turtle...")
Sleep(5)
turtle.refuel()
textutils.slowPrint("Turtle Successfuly Refueled")
else
textutils.slowPrint("Refueling Cancled")
textutils.slowPrint("Turtle Is Ready To Go!")
Ready = read()
write("TCP: ")
if Ready == (f) then
..f..
textutils.slowPrint("Turtle Moving Forward")
sleep(2)
term.clear()
if Ready == (B)/>/> then
..b..
textutils.slowPrint("Turtle Moving Back")
sleep(2)
term.clear()
if Ready == (l) then
..l..
textutils.slowPrint("Turtle Moving Left")
sleep(2)
term.clear()
if Ready == (r) then
..r..
textutils.slowPrint("Turtle Moving Right")
sleep(2)
term.clear()
end
Why Wont it work and can you make it smaller?