Advertisement
buttercheetah

Untitled

May 16th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. local computer = require("computer")
  2. local term = require("term")
  3. local component = require("component")
  4. local event = require("event")
  5. local m = component.modem
  6. op = require("component").openprinter
  7. os.execute("cls")
  8. print("===============")
  9. print(" ButOS")
  10. print("===============")
  11. os.execute("cls")
  12. print("===============")
  13. print(" ButOS")
  14. print("===============")
  15. print("booting")
  16. os.sleep(1)
  17. os.execute("cls")
  18. print("===============")
  19. print(" ButOS")
  20. print("===============")
  21. print("booting.")
  22. os.sleep(1)
  23. os.execute("cls")
  24. print("===============")
  25. print(" ButOS")
  26. print("===============")
  27. print("booting..")
  28. os.sleep(1)
  29. os.execute("cls")
  30. print("===============")
  31. print(" ButOS")
  32. print("===============")
  33. print("booting...")
  34. os.sleep(1)
  35. os.execute("cls")
  36. print("===============")
  37. print(" ButOS")
  38. print("===============")
  39. print("booting....")
  40. os.sleep(1)
  41. ::passstart::
  42. os.execute("cls")
  43. ::homep::
  44. os.execute("cls")
  45. print("===============")
  46. print(" ButOS V0.2")
  47. print("===============")
  48. print("please select option")
  49. print("1) Settings")
  50. print("2) Order Red Dragon")
  51. print("3) Print a Document")
  52. print("4) Order Food For Pickup - K-Roger")
  53. print("5) Shutdown")
  54. option = io.read("*l")
  55. if option == "1" then
  56. goto settings
  57. elseif option == "2" then
  58. goto pizza
  59. elseif option == "3" then
  60. goto prints
  61. elseif option == "5" then
  62. os.execute("shutdown")
  63. elseif option == "4" then
  64. goto Kro
  65. elseif option == "N-A-9175-B" then
  66. goto endit
  67. else
  68. os.execute("cls")
  69. print("error incorect syntax [" .. option .. "] please try again")
  70. os.sleep(3)
  71. goto homep
  72. end
  73. ::settings::
  74. os.execute("cls")
  75. print("===============")
  76. print(" ButOS V0.2")
  77. print("===============")
  78. print("1) Back")
  79. print("2) Update")
  80. option = io.read("*l")
  81. if option == "1" then
  82. goto homep
  83. elseif option == "2" then
  84. goto update
  85. elseif option == "9175" then
  86. goto updateE
  87. else
  88. os.execute("cls")
  89. print("error incorect syntax [" .. option .. "] please try again")
  90. os.sleep(3)
  91. goto settings
  92. end
  93. ::Kro::
  94. os.execute("cls")
  95. print("Connecting")
  96. m.open(85)
  97. m.broadcast(80, "ping")
  98. message=event.pull(5,"modem_message")
  99. if message == "modem_message" then
  100. goto krobeg
  101. else
  102. goto kroe
  103. end
  104. ::krobeg::
  105. os.execute("cls")
  106. print("name for order")
  107. kroname = io.read("*l")
  108. os.execute("cls")
  109. print("please list all items")
  110. kroit = io.read("*l")
  111. os.execute("cls")
  112. print("is this order correct?")
  113. print(kroname .. " ordered " .. kroit)
  114. print("y/n")
  115. kroect = io.read("*l")
  116. if kroect == "y" then
  117. print("order sent")
  118. elseif kroect == "n" then
  119. goto krobeg
  120. end
  121. m.broadcast(421, kroname .. " ordered " .. kroit)
  122. goto Kroend
  123.  
  124. ::kroe::
  125. os.execute("cls")
  126. print("error could not connect")
  127. os.sleep(2)
  128. ::Kroend::
  129. goto homep
  130. ::pizza::
  131. os.execute("cls")
  132. print("Connecting")
  133. m.open(75)
  134. m.broadcast(420, "ping")
  135. message=event.pull(15,"modem_message")
  136. if message == "modem_message" then
  137. goto name
  138. else
  139. goto pizend
  140. end
  141. ::name::
  142. os.execute("cls")
  143. print("name for order")
  144. name = io.read("*l")
  145. ::wdyw::
  146. os.execute("cls")
  147. print("What would you like")
  148. wdyws = io.read("*l")
  149. ::DOP::
  150. os.execute("cls")
  151. print("do you want pickup or delivery?")
  152. print("p - pickup d - delivery")
  153. dops = io.read("*l")
  154. if dops == "p" then
  155. adop = "pickup"
  156. address = "in store"
  157. elseif dops == "d" then
  158. adop = "delivery"
  159. os.execute("cls")
  160. print("what is the delivery address?")
  161. address = io.read("*l")
  162. else
  163. goto DOP
  164. end
  165. ::cor::
  166. os.execute("cls")
  167. print("is this order correct?")
  168. print(name .. " would like " .. wdyws .. " for " .. adop .. " at " .. address)
  169. print("y/n")
  170. correct = io.read("*l")
  171. if correct == "y" then
  172. print("order sent")
  173. elseif correct == "n" then
  174. goto wdyw
  175. else
  176. goto cor
  177. end
  178. m.broadcast(420, name .. " would like " .. wdyws .. " for " .. adop .. " at " .. address)
  179. goto pizzend
  180. ::pizend::
  181. os.execute("cls")
  182. print("error could not connect")
  183. os.sleep(2)
  184. ::pizzend::
  185. goto homep
  186. ::prints::
  187. ::beg::
  188. printsamou = 0
  189. pagepr = 0
  190. runth = 0
  191. os.execute("cls")
  192. print("set the title")
  193. title = io.read("*l")
  194. os.execute("cls")
  195. print("type contents (or [done] if finished)")
  196. print("dont type pass this line l")
  197. ::contents::
  198. content = ""
  199. printsamou = printsamou + 1
  200. content = io.read("*l")
  201. if content == "done" then goto aftercont end
  202. if printsamou == 20 then
  203. pagepr = pagepr + 1
  204. op.setTitle(title .. " - " .. pagepr)
  205. op.writeln(content)
  206. op.print()
  207. printsamou = 0
  208. goto contents
  209. else
  210. op.writeln(content)
  211. goto contents
  212. end
  213. ::aftercont::
  214. if pagepr > 0 then
  215. pagepr = pagepr + 1
  216. op.setTitle(title .. " - " .. pagepr)
  217. else
  218. op.setTitle(title)
  219. end
  220. op.print()
  221. os.execute("cls")
  222. print("printing")
  223. os.sleep(1)
  224. os.execute("cls")
  225. print("printing.")
  226. os.sleep(1)
  227. os.execute("cls")
  228. print("printing..")
  229. os.sleep(1)
  230. os.execute("cls")
  231. print("printing...")
  232. os.sleep(1)
  233. os.execute("cls")
  234. print("printing....")
  235. os.sleep(1)
  236. os.execute("cls")
  237. goto homep
  238. ::update::
  239. os.execute("pastebin get -f 2UEPNuC1 butos")
  240. print("type [butos] to start the system")
  241. ::updateE::
  242. os.execute("pastebin get -f QnTXxSHP butose")
  243. os.execute("del .shrc")
  244. file = io.open(".shrc", "w")
  245. file:write("/home/butose")
  246. print("type [butose] to start the system")
  247. ::endit::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement