I need help with another program:
Some friends and me would like to control a turtle wireless by hitting keys on the keyboard but no program works:
The CC-Version:1.3.3
My version:
Computer:
local b
rednet.open("top")
while true do
print("Taste drücken!")
b = os.pullEvent("key")
rednet.send(150,:P/>/>
end
Turtl(wireless, mining):
rednet.open("right")
while true do
x,y,z = rednet.receive()
if y == "17" then
turtle.forward()
elseif y == "31" then
turtle.back()
elseif y == "30" then
turtle.turnLeft()
elseif y == "32" then
turtle.turnRight()
elseif y == "42" then
turtle.down()
elseif y == "57" then
turtle.up()
elseif y == "75" then
turtle.dig()
elseif y == "71" then
turtle.digUp()
elseif y == "79" then
turtle.digDown()
elseif y == "77" then
turtle.place()
elseif y == "73" then
turtle.placeUp()
elseif y == "81" then
turtle.placeDown()
elseif y == "21" then
turtle.select(1)
elseif y == "3" then
turtle.select(2)
elseif y == "4" then
turtle.select(3)
elseif y == "5" then
turtle.select(4)
elseif y == "6" then
turtle.select(5)
elseif y == "7" then
turtle.select(6)
elseif y == "8" then
turtle.select(7)
elseif y == "9" then
turtle.select(8)
elseif y == "10" then
turtle.select(9)
end
end
The result: No error-message. Nothings happens by hitting a key, e.g. "A".
Code from my friend:
Computer:
shell.run("clear")
rednet.open("left")
while true do
print("Bitte Befehle angeben!")
cmd = os.pullEvent("key")
if cmd == 44 then
print("")
print("Welche Seite? (Bitte auf Englisch angeben!)")
write("->")
cmd = io.read()
rednet.send(150, cmd)
else
rednet.send(150, cmd)
end
shell.run("clear")
end
Turtle:
rednet.open("right")
while true do
x,y,z == rednet.receive()
if y = 17 then
turtle.forward()
elseif y == 32 then
turtle.turnRight()
elseif y == 30 then
turtle.turnLeft()
elseif y == 42 then
turtle.down()
elseif y == 57 then
turtle.up()
elseif y == 31 then
turtle.back()
elseif y == 203 then
turtle.dig()
elseif y == 208 then
turtle.digDown()
elseif y == 200 then
turtle.digUp()
elseif y == 37 then
turtle.place()
elseif y == 24 then
turtle.placeUp()
elseif y == 38 then
turtle.placeDown()
end
end
The Result: Nothing happens, too.
Hope you can help me.
Thanks