Advertisement
buffsovernexus

Untitled

May 21st, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. --[[
  2.  
  3. MineBotHost v1.0.0
  4.  
  5. ]]--
  6.  
  7. function findModem()
  8. local periList = peripheral.getNames()
  9.  
  10. for i = 1, #periList do
  11. if peripheral.getType(periList[i]) == "modem" then
  12. return periList[i]
  13. end
  14. end
  15. return nil
  16. end
  17.  
  18. function findMonitor()
  19. local periList = peripheral.getNames()
  20.  
  21. for i = 1, #periList do
  22. if peripheral.getType(periList[i]) == "monitor" then
  23. return periList[i]
  24. end
  25. end
  26. return nil
  27. end
  28.  
  29. -- Find the side of the modem and activate it.
  30. local modem = findModem()
  31.  
  32. if rednet.isOpen(modem) == false then
  33. rednet.open(modem)
  34. end
  35.  
  36. -- Find the monitor connected to the PC.
  37. local monitor = findMonitor()
  38.  
  39. if monitor == nil then
  40. print("ERROR: Unable to find monitor...")
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement