Advertisement
Corbinhol

ComputerCraft Quarry System

Sep 12th, 2022 (edited)
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1.  
  2. --Clears The Screen
  3. term.clear();
  4.  
  5.  
  6. local run = false;
  7. print("Starting...");
  8. print("Checking For Wireless Modem...");
  9.  
  10. --Checks to make sure that the computer has a modem installed.
  11. local hasModem = false;
  12. local modemSide;
  13. if peripheral.getType("right") == "modem" then hasModem = true; modemSide = "right";
  14. elseif peripheral.getType("left") == "modem" then hasModem= true; modemSide = "left";
  15. elseif peripheral.getType("front") == "modem" then hasModem= true; modemSide = "front";
  16. elseif peripheral.getType("back") == "modem" then hasModem= true; modemSide = "back";
  17. elseif peripheral.getType("top") == "modem" then hasModem= true; modemSide = "top";
  18. elseif peripheral.getType("bottom") == "modem" then hasModem= true; modemSide = "bottom";
  19. else term.setTextColor(colors.red); print("Error: No Modem Found! Please ensure that a modem is connected to the pc."); term.setTextColor(colors.white);
  20. end
  21.  
  22. if hasModem then
  23.     term.setTextColor(colors.green);
  24.     print("Successfully found modem on " .. modemSide .. "side!");
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement