Guest User

send

a guest
Jun 23rd, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local tArgs = {...}
  2. rednet.close("top")
  3. rednet.open("top")
  4. if tArgs[1] == nil or tArgs[2] == nil or tArgs[1] and tArgs[2] == nil then
  5. print("Error!")
  6. print("Correct usage: send <id> <message>")
  7. elseif tArgs[1] and tArgs[2] == nil then
  8. print("Error!")
  9. print("Correct usage: send <id> <message>")
  10. elseif tArgs[1] == nil then
  11. print("Error!")
  12. print("Correct usage: send <id> <mesage>")
  13. elseif tArgs[2] == nil then
  14. print("Error!")
  15. print("Correct usage: send <id> <message>")
  16. else
  17. print("ID: "..tArgs[1])
  18. print("Message: "..tArgs[2])
  19. print("Type y to send.")
  20. print("Type n to not send.")
  21. write("y/n: ")
  22. local input = io.read()
  23. input = string.lower(input)
  24. tArgs[1] = tonumber(tArgs[1])
  25. if input == "y" then
  26. rednet.send(tArgs[1], tArgs[2])
  27. else
  28. print("Not sending!")
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment