Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- rednet.close("top")
- rednet.open("top")
- if tArgs[1] == nil or tArgs[2] == nil or tArgs[1] and tArgs[2] == nil then
- print("Error!")
- print("Correct usage: send <id> <message>")
- elseif tArgs[1] and tArgs[2] == nil then
- print("Error!")
- print("Correct usage: send <id> <message>")
- elseif tArgs[1] == nil then
- print("Error!")
- print("Correct usage: send <id> <mesage>")
- elseif tArgs[2] == nil then
- print("Error!")
- print("Correct usage: send <id> <message>")
- else
- print("ID: "..tArgs[1])
- print("Message: "..tArgs[2])
- print("Type y to send.")
- print("Type n to not send.")
- write("y/n: ")
- local input = io.read()
- input = string.lower(input)
- tArgs[1] = tonumber(tArgs[1])
- if input == "y" then
- rednet.send(tArgs[1], tArgs[2])
- else
- print("Not sending!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment