Advertisement
austinv11

startupanimation

Oct 31st, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. term.clear()
  2.  
  3. --Welcoming!
  4. --y = 10 x = 26
  5. local localVersion = "0.1"
  6.  
  7. local function centerText(text)
  8. local x,y = term.getSize()
  9. local x2,y2 = term.getCursorPos()
  10. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  11. write(text)
  12. end
  13.  
  14. local function clearScreen()
  15.     term.clear()
  16.     term.setCursorPos(1,10)
  17. end
  18.  
  19. local function animation()
  20.     centerText("Welcome to")
  21.     sleep(3)
  22.     clearScreen()
  23.     term.setCursorPos(22,10)
  24.     print("austin")
  25.     sleep(1)
  26.     term.setTextColor(colors.yellow)
  27.     term.setCursorPos(28,10)
  28.     print("OS")
  29.     term.setTextColor(colors.white)
  30.     sleep(3)
  31. end
  32.  
  33. clearScreen()
  34. term.setCursorPos(1,1)
  35. term.setTextColor(colors.red)
  36. centerText("Press 'enter' to login")
  37. local _, check = os.pullEvent("key")
  38. if check == 28 then
  39.     animation()
  40.     clearScreen()
  41.     term.setCursorPos(1,1)
  42.     shell.run("austinOS-Core")
  43. else
  44.     os.reboot()
  45.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement