Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. function isModemName(name)
  2. if name == "top" or name == "bottom" or name == "front" or name == "back" or name == "left" or name == "right" then
  3. return true
  4. end
  5. return false
  6. end
  7.  
  8. function isModem (name)
  9. if peripheral.isPresent(name) and peripheral.getType(name) == "modem" then
  10. return true
  11. end
  12. return false
  13. end
  14.  
  15. args = {...}
  16. if table.getn(args) ~= 2 then
  17. print("NetRepeat By UDXS")
  18. print("Error: Incorrect Usage")
  19. print("Correct Format: \"NetRepeat <Modem1> <Modem2>\"")
  20. return
  21. end
  22.  
  23. if not isModemName(args[1]) and not isModemName(args[2]) then
  24. print ("NetRepeat By UDXS")
  25. print("Error: Invalid Modem Names")
  26. print("Possible Names: \"top\", \"bottom\", \"front\", \"back\", \"left\", \"right\"")
  27. return
  28. end
  29.  
  30. if not isModem(args[1]) and not isModem(args2) then
  31. print"NetRepeat By UDXS")
  32. print("Error: One or More Modems Not Connected")
  33. print("Possible Names: \"top\", \"bottom\", \"front\", \"back\", \"left\", \"right\"")
  34. return
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement