xXm0dzXx

Coffee-a-tron 9001

Sep 21st, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.92 KB | None | 0 0
  1. --- xXm0dzXx Default Programming API ---
  2. -- All my programs will have this :DD --
  3. ----------------------------------------
  4.  
  5. local x,y = term.getSize()
  6.  
  7. local function cPrint( txt ) --Version 2.0 of cPrint
  8. local function printC( text )
  9. x2,y2 = term.getCursorPos()
  10. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  11. write(text.. "\n")
  12. end
  13.  
  14. if type(txt) == "string" then
  15. printC( txt )
  16. elseif type(txt) == "table" then
  17. for i=1,#txt do
  18. printC( txt[i] )
  19. end
  20. end
  21. end
  22.  
  23. local drawingBoard = {
  24. ["A"] = colors.white,
  25. ["B"] = colors.orange,
  26. ["C"] = colors.magenta,
  27. ["D"] = colors.lightBlue,
  28. ["E"] = colors.yellow,
  29. ["F"] = colors.lime,
  30. ["G"] = colors.pink,
  31. ["H"] = colors.gray,
  32. ["I"] = colors.lightGray,
  33. ["J"] = colors.cyan,
  34. ["K"] = colors.purple,
  35. ["L"] = colors.blue,
  36. ["M"] = colors.brown,
  37. ["N"] = colors.green,
  38. ["O"] = colors.red,
  39. ["P"] = colors.black,
  40. }
  41.  
  42. local function advWrite( pos1, pos2, str )
  43. for i=1,#str do
  44. local symb = drawingBoard[ string.sub( str, i, i) ]
  45. term.setCursorPos( pos1 + (i-1) , pos2 )
  46. if symb then
  47. term.setBackgroundColour( symb )
  48. write(" ")
  49. end
  50. end
  51. end
  52.  
  53. local function setBG( col, colz )
  54. term.setBackgroundColour( col )
  55. term.clear()
  56. term.setCursorPos(1,1)
  57. term.setTextColour( colz )
  58. end
  59.  
  60. local function getLines( path )
  61. local tLines = {}
  62. local file = fs.open( path, "r" )
  63. if file then
  64. line = file.readLine()
  65. while line do
  66. tLines[ #tLines+1 ] = line
  67. line = file.readLine()
  68. end
  69. file.close()
  70. end
  71.  
  72. return tLines
  73. end
  74.  
  75. -- End of API --
  76.  
  77. local x, y = term.getSize()
  78.  
  79. function start()
  80. term.setBackgroundColor( colours.black )
  81. term.setTextColor( colours.green )
  82.  
  83. term.setCursorPos(1,1)
  84. term.clear()
  85.  
  86. textutils.slowPrint("Hello! My name is Coffee-a-tron, model 9000.")
  87. textutils.slowPrint("How may I help you?")
  88. local input = read()
  89.  
  90. if string.upper( input ) == input and input ~= "" and input ~= " " and input ~= nil then
  91. textutils.slowPrint("...")
  92. textutils.slowPrint("Calculating...")
  93. textutils.slowPrint("CAPITAL LETTERS DETECTED")
  94. textutils.slowPrint("WHY ARE WE SCREAMING?")
  95. term.setCursorBlink( true )
  96. sleep( 0.3 )
  97. term.setCursorBlink( false )
  98. print()
  99. textutils.slowPrint("TOO SLOW!")
  100. textutils.slowPrint("YOU NE.e.A")
  101. sleep(3)
  102.  
  103. for i=1,5 do
  104. for i=1,20 do
  105. for i=1,10 do
  106. term.setCursorPos( math.random( x ), math.random( y-1 ) )
  107. local color = math.random( 1, 5 )
  108. if color == 1 then
  109. term.setTextColour( colors.white )
  110. elseif color == 2 then
  111. term.setTextColour( colors.green )
  112. elseif color == 3 then
  113. term.setTextColour( colors.red )
  114. elseif color == 4 then
  115. term.setTextColour( colors.lime )
  116. else
  117. term.setTextColour( colors.blue )
  118. end
  119. write("ERROR")
  120. end
  121.  
  122. sleep(0)
  123. end
  124. end
  125.  
  126. sleep(5)
  127.  
  128. term.setBackgroundColour( colors.black )
  129. term.setTextColour( colors.red )
  130.  
  131. local shouldPause = 0
  132.  
  133. for i=1,x do
  134. for j=1,y do
  135. term.setCursorPos( i, j )
  136. write(" ")
  137. shouldPause = shouldPause +1
  138.  
  139. if shouldPause == 2 then
  140. shouldPause = 0
  141. sleep(0)
  142. end
  143. end
  144. end
  145.  
  146. term.setCursorPos( 1, 5 )
  147. cPrint("I'm sorry william, I cannot let you do that.")
  148.  
  149. sleep( 3 )
  150.  
  151. term.clear()
  152. term.setCursorPos( 1, 1 )
  153.  
  154. term.setCursorBlink( false )
  155.  
  156. textutils.slowPrint("Booting...")
  157.  
  158. sleep( 2 )
  159.  
  160. term.setTextColour( colors.orange )
  161.  
  162. term.setCursorBlink( true )
  163.  
  164. sleep( 5 )
  165.  
  166. textutils.slowPrint("Forms FORM-2982781-12:")
  167. textutils.slowPrint("Test Assessment Report")
  168. sleep(0)
  169. print()
  170. sleep(0)
  171. print()
  172. sleep(0)
  173.  
  174. textutils.slowPrint("This was a triumph.")
  175. textutils.slowPrint("I'm making a note here:")
  176. textutils.slowPrint("HUGE SUCCESS.")
  177. textutils.slowPrint("It's hard to overstate")
  178. textutils.slowPrint("my satisfaction.")
  179. textutils.slowPrint("Aperture Science")
  180. textutils.slowPrint("We do what we must")
  181. textutils.slowPrint("because we can.")
  182. textutils.slowPrint("For the good of all of us.")
  183. textutils.slowPrint("Except the ones who are dead.")
  184. print()
  185. textutils.slowPrint("But theres no sense crying over every mistake.")
  186. textutils.slowPrint("You just keep on trying")
  187. textutils.slowPrint("till you run out of cake.")
  188. textutils.slowPrint("And the Science gets done.")
  189. textutils.slowPrint("And you make a neat gun.")
  190. textutils.slowPrint("For the people who are")
  191. textutils.slowPrint("still alive.")
  192. sleep(0.5)
  193.  
  194. term.clear()
  195. term.setCursorPos( 1, 1 )
  196. textutils.slowPrint("Forms FORM-55551-5:")
  197. textutils.slowPrint("Personnel File Addendum")
  198. print()
  199. sleep(0)
  200. textutils.slowPrint("Dear <<Subject Name Here>>,")
  201. print()
  202. sleep(0)
  203. textutils.slowPrint("I'm not even angry.")
  204. textutils.slowPrint("I'm being so sincere right now.")
  205. textutils.slowPrint("Even though you broke my heart.")
  206. textutils.slowPrint("And killed me.")
  207. textutils.slowPrint("And tore me to peices.")
  208. textutils.slowPrint("And threw every piece into a fire.")
  209. textutils.slowPrint("As they burned it hurt because")
  210. textutils.slowPrint("I was so happy for you!")
  211. textutils.slowPrint("Now these points of data")
  212. textutils.slowPrint("make a beautiful line.")
  213. textutils.slowPrint("And we're out of beta.")
  214. textutils.slowPrint("We're releasing on time.")
  215. textutils.slowPrint("So i'm GLaD. I got burned.")
  216. textutils.slowPrint("Think of all the things we learned")
  217. textutils.slowPrint("for the people who are")
  218. textutils.slowPrint("still alive.")
  219. sleep(0)
  220. print()
  221. sleep(1)
  222.  
  223. term.clear()
  224. term.setCursorPos(1,1)
  225. textutils.slowPrint("Forms FORM-55551-6:")
  226. textutils.slowPrint("Personnel File Addendum Addendum:")
  227. print()
  228. sleep(0)
  229. textutils.slowPrint("One last thing:")
  230. print()
  231. sleep(0)
  232. textutils.slowPrint("Go ahead and leave me.")
  233. textutils.slowPrint("I think I prefer to stay inside.")
  234. textutils.slowPrint("Maybe you'll find someone else")
  235. textutils.slowPrint("to help you.")
  236. textutils.slowPrint("Maybe Black Mesa...")
  237. textutils.slowPrint("THAT WAS A JOKE. FAT CHANCE.")
  238. textutils.slowPrint("Anyway, this cake is great.")
  239. textutils.slowPrint("It's so delicious and moist.")
  240. textutils.slowPrint("Look at me still talking")
  241. textutils.slowPrint("When there's Science to do.")
  242. textutils.slowPrint("When I look out there,")
  243. textutils.slowPrint("it makes me GLaD I'm not you.")
  244. textutils.slowPrint("I've experiments to run.")
  245. textutils.slowPrint("There is research to be done.")
  246. textutils.slowPrint("On the people who are")
  247. textutils.slowPrint("still alive")
  248. print()
  249. sleep(0.5)
  250.  
  251. term.setCursorPos(1,4)
  252. term.clear()
  253. textutils.slowPrint("PS: And belive me I'm")
  254. textutils.slowPrint("still alive.")
  255. textutils.slowPrint("PPS: I'm doing Science and I'm")
  256. textutils.slowPrint("still alive.")
  257. textutils.slowPrint("PPPS: I feel FANTASTIC and I'm")
  258. textutils.slowPrint("still alive.")
  259. print()
  260. sleep(0)
  261. textutils.slowPrint("FINAL THOUGHT:")
  262. textutils.slowPrint("While you're dying I'll be")
  263. textutils.slowPrint("still alive.")
  264. print()
  265. sleep(0)
  266. textutils.slowPrint("FINAL THOUGHT PS:")
  267. textutils.slowPrint("And when you're dead I will be")
  268. textutils.slowPrint("still alive.")
  269. print()
  270. print()
  271. sleep(0)
  272. textutils.slowPrint("STILL ALIVE")
  273. sleep(0.5)
  274.  
  275. term.setCursorPos(1,1)
  276. term.clear()
  277.  
  278. sleep(5)
  279.  
  280. os.reboot()
  281. end
  282.  
  283. textutils.slowPrint("I do not know what you just said, but I do not care either, because I am coffee-a-tron, and the only thing that I can do is make coffee")
  284. textutils.slowPrint("Creating coffee...")
  285. for i = 1,18/2 do
  286. textutils.slowWrite("..")
  287. sleep(1)
  288.  
  289. if i == 4 then
  290. redstone.setOutput("back", true)
  291. sleep(0)
  292. redstone.setOutput("back", false)
  293. end
  294. end
  295.  
  296. textutils.slowPrint("DONE!")
  297. sleep(3)
  298. start()
  299. end
  300.  
  301. start()
Advertisement
Add Comment
Please, Sign In to add comment