Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local delay = 2
- local tArgs = {...}
- local id = -1
- term.clear()
- term.setCursorPos(1,1)
- rednet.open("top")
- if tonumber(tArgs[1]) ~= nil then
- id = tonumber(tArgs[1])
- end
- print("LeoSat Console -- Receiver ID: "..id)
- print("-----------------\n")
- while true do
- write("> ")
- cmd = read()
- if cmd == "" then
- print("Invalid Command!")
- elseif cmd == "exit" then
- return
- else
- if id == -1 then
- rednet.broadcast(cmd)
- else
- rednet.send(id, cmd)
- end
- os.startTimer(delay)
- while true do
- evt, p1, p2, p3 = os.pullEvent()
- if evt == "timer" then
- break
- elseif evt == "rednet_message" then
- print(p1,": ",p2)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment