Advertisement
buffsovernexus

Untitled

May 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. --[[
  2.  
  3. MineBotHost v1.0.0
  4.  
  5. ]]--
  6.  
  7. local globals = { version = "1.0.0" }
  8.  
  9. function findModem()
  10. local periList = peripheral.getNames()
  11.  
  12. for i = 1, #periList do
  13. if peripheral.getType(periList[i]) == "modem" then
  14. return periList[i]
  15. end
  16. end
  17. return nil
  18. end
  19.  
  20. function findMonitor()
  21. local periList = peripheral.getNames()
  22.  
  23. for i = 1, #periList do
  24. if peripheral.getType(periList[i]) == "monitor" then
  25. return periList[i]
  26. end
  27. end
  28. return nil
  29. end
  30.  
  31. -- Find the side of the modem and activate it.
  32. local modem = findModem()
  33.  
  34. if modem == nil then
  35. print("ERROR: You need a modem.")
  36. else
  37. if rednet.isOpen(modem) == false then
  38. print("MODEM: Turning on modem.")
  39. rednet.open(modem)
  40. rednet.host("mbtp", "mbh")
  41. print("Protocol: mbtp")
  42. print("HostName: mbh")
  43. end
  44. end
  45.  
  46. -- Find the monitor connected to the PC.
  47. local monitor = findMonitor()
  48.  
  49. if monitor == nil then
  50. print("ERROR: You need a secondary monitor.")
  51. end
  52.  
  53. local user = { input = "" }
  54.  
  55. while user.input ~= "x" do
  56. term.clear()
  57. print(" MineBotHost v", globals.version, " Menu")
  58. print("--------------------------------------------------------")
  59. print("r - Return Bot To Host")
  60. print("l - Location of the MineBot")
  61. print("x - Exit this program")
  62. print("Your Response: ")
  63. user.input = read()
  64.  
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement