KnotMeDaddy

Dem bois OS (Port from Batch to Lua)

Jan 31st, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.51 KB | None | 0 0
  1. --Just some badly made Batch OS that I ported to CC Lua.
  2. --Original: https://youtu.be/EmiGL60OGtc
  3.  
  4. os.pullEvent = os.pullEventRaw
  5. term.setBackgroundColor(colors.blue)
  6.  
  7. function anykey()
  8. print "Press any key to continue . . ."
  9. os.pullEvent("key")
  10. end
  11.  
  12. --Clears the screen
  13. function clear()
  14.   term.clear()
  15.   term.setCursorPos(1,1)
  16. end
  17.  
  18. function boot()
  19. clear()
  20. print "Dem bois OS System Disk found!"
  21. print "Starting up... 1%"
  22. print "Starting up... 7%"
  23. print "Starting up... 50%"
  24. print "Starting up... 93%"
  25. print "Starting up... 100%"
  26. print "Loading complete!"
  27. anykey()
  28. begin()
  29. end
  30.  
  31. function begin()
  32. clear()
  33. print "What is your first name?"
  34. local fname = read()
  35. print "What is your last name?"
  36. local lname = read()
  37. print("Hello " ..fname.. " " ..lname.. "!")
  38. anykey()
  39. home()
  40. end
  41.  
  42. function home()
  43. clear()
  44. print "Here are a few programs that you can use."
  45. print "(1) System Information"
  46. print "(2) Notepad"
  47. print "(3) Zombie Attack"
  48. print "(4) Calculator"
  49. print "(5) Browser"
  50. write "Choose-"
  51. local input = read()
  52.  
  53. if input == "1" then
  54. specs()
  55. elseif input == "2" then
  56. notepad()
  57. elseif input == "3" then
  58. zombie()
  59. elseif input == "4" then
  60. -- this in intended, it's a bug in the real dem bois os
  61. man()
  62. else
  63. home()
  64. end
  65. end
  66.  
  67. function specs()
  68. clear()
  69. print "4GB of RAM, Intel(R) Pentium(R) CPU G630 @ 2.70GHz 2.70 GHz"
  70. print "222GB SSD."
  71. anykey()
  72. home()
  73. end
  74.  
  75. function notepad()
  76. clear()
  77. print "Are you ready to open Notepad?"
  78. anykey()
  79.  
  80. if settings.get("shutdownos.password") then
  81. shell.run "shutdownedit goto YSOS.txt"
  82. else
  83. shell.run "edit goto YSOS.txt"
  84. end
  85.  
  86. home()
  87. end
  88.  
  89. function zombie()
  90. clear()
  91. print "Welcome to Zombie Atttack"
  92. print "In this game you fight zombies."
  93. print "(1) Begin"
  94. print "(2) Exit"
  95. write "Choose-"
  96. local input = read()
  97.  
  98. if input == "1" then
  99. fight()
  100. elseif input == "2" then
  101. home()
  102. else
  103. zombie()
  104. end
  105.  
  106. end
  107.  
  108. function man()
  109. clear()
  110. print "You find a strange man in the woods,"
  111. print "you think he is just a man, but really, he's a zombie!"
  112. print "Entering Battle 1..."
  113. anykey()
  114. fight()
  115. end
  116.  
  117. function fight()
  118. clear()
  119. print "Zombie used Bite!"
  120. print "Your health fell by -5hp!"
  121. print "You have 3 attacks."
  122. print "(1) Punch"
  123. print "(2) Slap"
  124. print "(3) Kick in the butt"
  125. write "Choose-"
  126. local input = read()
  127.  
  128. if input == "1" then
  129. done()
  130. else
  131. fight()
  132. end
  133.  
  134. end
  135.  
  136. function done()
  137. clear()
  138. print "You used Punch!"
  139. print "Congrafulations!"
  140. print "You beat the Zombie!"
  141. print "Thanks for playing!"
  142. anykey()
  143. home()
  144. end
  145.  
  146. boot()
Advertisement
Add Comment
Please, Sign In to add comment