Posted 30 May 2015 - 05:31 AM
So I'm trying to make a neat program that will allow me to tell my wireless turtle commands using my pocket computer to make my turtle to do stuff. Here is what I have written out to make it mine downward in a stair-like way (Mining down and forward, etc)
The issue I'm having with this is it doesnt do anything whenever I run this and use a rednet.send([id of turtle], "stairs") message on my pocket computer. Doesn't pull up an error for my code whenever I execute it and it doesn't pull an error for my rednet.send(). I honestly do not know where to go from this.
function getMessage(x)
if x == "stairs" then
local running = true
if turtle.getFuelLevel() == 0 then
running = fales
end
if turtle.digDown() then
turtle.down()
if turtle.dig() then
turtle.forward()
end
end
while running do
if turtle.digDown() then
turtle.dig()
turtle.down()
turtle.dig()
while not turtle.forward() do
turtle.dig()
end
end
if turtle.getFuelLevel == 0 then
running = false
end
end
end
end
rednet.open("right")
while true do
id, message = rednet.receive()
if id == 7 then
getMessage(message)
end
end
The issue I'm having with this is it doesnt do anything whenever I run this and use a rednet.send([id of turtle], "stairs") message on my pocket computer. Doesn't pull up an error for my code whenever I execute it and it doesn't pull an error for my rednet.send(). I honestly do not know where to go from this.