Advertisement
DOGGYWOOF

Untitled

Oct 6th, 2024 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. -- Example code for sending commands from another computer
  2. rednet.open("top") -- Open the Rednet modem
  3. local id = rednet.lookup("turtle") -- Find the turtle's ID by its name (optional)
  4.  
  5. while true do
  6. print("Enter command (forward, backward, left, right, load, exit): ")
  7. local command = read()
  8.  
  9. -- Send the command to the turtle
  10. rednet.send(id, command)
  11.  
  12. if command == "exit" then
  13. break -- Exit the sending loop
  14. end
  15. end
  16.  
  17. rednet.close("top")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement