This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
bpat's profile picture

making a remote turtle program

Started by bpat, 04 May 2013 - 03:45 PM
bpat #1
Posted 04 May 2013 - 05:45 PM
So I am making a remote turtle program and I want to make it so on the computer at the beginning I can type in the id of the turtle and it will always use that id until I restart the program
here is my pogram

term.setBackgroundColor(colors.cyan)
print("  ")
term.clear()
rednet.open("top")
while true do
event, e = os.pullEvent("key")
if e == 203 then
  rednet.send(75,"left")

and so forth how would I make it so the 75 would be an input that I enter and stay there so I can do multiple turtle's
H4X0RZ #2
Posted 04 May 2013 - 06:03 PM
You have to add the commands:

 term.setBackgroundColor(colors.cyan) 
print(" ") 
term.clear() 
rednet.open("top") 
input = tonumber(read()) --read a user input
while true do 
event, e = os.pullEvent("key") 
if e == 203 then 
rednet.send(input,"your command")
end
end
bpat #3
Posted 04 May 2013 - 06:08 PM
thanks this works great