Advertisement
Hydroxios

Server

Dec 21st, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. rednet.open("top")
  2.  
  3. local function check_response()
  4.         id, message = rednet.receive("response", 20480)
  5.         print(message)
  6. end
  7.  
  8. while true do
  9.     print("Enter your command :")
  10.     cmd = read()
  11.     if cmd == "start" then
  12.         print("starting command has been send !")
  13.         rednet.send(5, cmd, "cmd")
  14.         check_response()
  15.     elseif cmd == "stop" then
  16.         print("stoping command has been send !")
  17.         rednet.send(5, cmd, "cmd")
  18.         check_response()
  19.     end
  20.     print("Command succesfully send !")
  21.     os.sleep(0.1)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement