Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- local function check_response()
- id, message = rednet.receive("response", 20480)
- print(message)
- end
- while true do
- print("Enter your command :")
- cmd = read()
- if cmd == "start" then
- print("starting command has been send !")
- rednet.send(5, cmd, "cmd")
- check_response()
- elseif cmd == "stop" then
- print("stoping command has been send !")
- rednet.send(5, cmd, "cmd")
- check_response()
- end
- print("Command succesfully send !")
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement