Advertisement
minecraftv250

OS beta 1

Feb 16th, 2013
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. x, y = term.getSize()
  3. mm = true
  4. u = true
  5. p = true
  6. function cprint(text, yp)
  7. cx = math.ceil((x/2)-(string.len(text)/2))
  8. term.setCursorPos(cx, yp)
  9. print(text)
  10. end
  11. function cwrite( text, yp)
  12. cx = math.ceil((x/2)-(string.len(text)/2))
  13. term.setCursorPos(cx, yp)
  14. write(text)
  15. end
  16. function mmenu()
  17. term.setCursorPos(1,1)
  18. --print("--------------------------------------------------")
  19. cprint("Easy OS Beta 1.0",2)
  20. term.setCursorPos(1,3)
  21. print("--------------------------------------------------")
  22. end
  23. function clear()
  24. term.clear()
  25. term.setCursorPos(1,1)
  26. end
  27. clear()
  28. cprint("Loading Easy OS",8)
  29. cprint("---------------",9)
  30. cprint("---------------",11)
  31. cprint("Version: Beta 1.0",12)
  32. cprint("[             ]",10)
  33. sleep(.5)
  34. cprint("[#            ]",10)
  35. sleep(.5)
  36. cprint("[##           ]",10)
  37. sleep(.5)
  38. cprint("[###          ]",10)
  39. sleep(.5)
  40. cprint("[####         ]",10)
  41. sleep(.5)
  42. cprint("[#####        ]",10)
  43. sleep(.5)
  44. cprint("[######       ]",10)
  45. sleep(.5)
  46. cprint("[#######      ]",10)
  47. sleep(.5)
  48. cprint("[########     ]",10)
  49. sleep(.5)
  50. cprint("[#########    ]",10)
  51. sleep(.5)
  52. cprint("[##########   ]",10)
  53. sleep(.5)
  54. cprint("[###########  ]",10)
  55. sleep(.5)
  56. cprint("[############ ]",10)
  57. sleep(.5)
  58. cprint("[#############]",10)
  59. sleep(1)
  60. while u == true do
  61. clear()
  62. mmenu()
  63. cprint("Username: ",9)
  64. cprint("Password: ",10)
  65. cwrite("Username: ",9)
  66. local usar = read()
  67. if usar == "admin" then
  68. u = false
  69. end
  70. end
  71. while p == true do
  72.  
  73.  
  74. cwrite("Password: ",10)
  75. pass = read("*")
  76. if pass == "admin" then
  77. p = false
  78. end
  79. end
  80. sid = 0
  81.  
  82. function menu(id, text)
  83. if sid == id then
  84. write("> ")
  85. else
  86. write("  ")
  87. end
  88. print(text)
  89. end
  90. while mm == true do
  91. clear()
  92. mmenu()
  93.  
  94. term.setCursorPos(cx, 8)
  95. menu(0,"Programs")
  96. term.setCursorPos(cx, 9)
  97. menu(1,"Command")
  98. term.setCursorPos(cx, 10)
  99. menu(2,"Shutdown")
  100. term.setCursorPos(cx, 11)
  101. menu(3,"WebBrowser")
  102. event, key = os.pullEvent("key")
  103. if key == 200 then
  104. if sid > 0 then
  105. sid = sid - 1
  106. end
  107. elseif key == 208 then
  108. if sid < 3 then
  109. sid = sid +1
  110. end
  111. elseif key == 28 then
  112. if sid == 0 then
  113. mm = false
  114. shell.run("programs")
  115. elseif sid == 1 then
  116. shell.run("shell")
  117. elseif sid == 2 then
  118. os.shutdown()
  119. elseif sid == 3 then
  120. mm = false
  121. shell.run("googlex")
  122. end
  123. end
  124. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement