Guest User

startup

a guest
Nov 21st, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. --Functions
  2. function clearScreen()
  3.   term.clear()
  4.   term.setCursorPos(1,1)
  5. end
  6.  
  7. function openModem()
  8.   for i,v in pairs(rs.getSides()) do
  9.     if peripheral.getType(v) == "modem" then
  10.       if not rednet.isOpen(v) then rednet.open(v) end
  11.     return true end
  12. end
  13. return false end
  14.  
  15. --Start doing stuff
  16. clearScreen()
  17. print("Welcome to TypOS v. 0.1 Alpha")
  18. print("Attempting to open modem...")
  19. openModem()
  20. local output = openModem()
  21. if output = true then
  22.   print("Opened modem successfully!")
  23. elseif output = false then
  24.   print("There was an error in opening your modem.")
  25.   print("TypOS will run in off-line mode")
  26.   offline = true
  27. end
Advertisement
Add Comment
Please, Sign In to add comment