Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- MineBotHost v1.0.0
- ]]--
- local globals = { version = "1.0.0" }
- function findModem()
- local periList = peripheral.getNames()
- for i = 1, #periList do
- if peripheral.getType(periList[i]) == "modem" then
- return periList[i]
- end
- end
- return nil
- end
- function findMonitor()
- local periList = peripheral.getNames()
- for i = 1, #periList do
- if peripheral.getType(periList[i]) == "monitor" then
- return periList[i]
- end
- end
- return nil
- end
- -- Find the side of the modem and activate it.
- local modem = findModem()
- if modem == nil then
- print("ERROR: You need a modem.")
- else
- if rednet.isOpen(modem) == false then
- print("MODEM: Turning on modem.")
- rednet.open(modem)
- rednet.host("mbtp", "mbh")
- print("Protocol: mbtp")
- print("HostName: mbh")
- end
- end
- -- Find the monitor connected to the PC.
- local monitor = findMonitor()
- if monitor == nil then
- print("ERROR: You need a secondary monitor.")
- end
- local user = { input = "" }
- while user.input ~= "x" do
- term.clear()
- print(" MineBotHost v", globals.version, " Menu")
- print("--------------------------------------------------------")
- print("r - Return Bot To Host")
- print("l - Location of the MineBot")
- print("x - Exit this program")
- print("Your Response: ")
- user.input = read()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement