HaZePug

main

Mar 11th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. function s(...) return sleep(...) end
  2. function w(...) return write(...) end
  3. function p(...) return print(...) end
  4. function tw(...) return term.write(...) end
  5. function scp(...) return term.setCursorPos(...) end
  6. function sbc(...) return term.setBackgroundColor(...) end
  7. function stc(...) return term.setTextColor(...) end
  8. function tc(...) return term.clear(...) end
  9. function tcl(...) return term.clearLine() end
  10. function scb(...) return term.setCursorBlink(...) end
  11. function ts(...) return term.scroll(...) end
  12. function r(...) return shell.run(...) end
  13. function para(...) return parallel.waitForAny(...) end
  14. function sw(...) return textutils.slowWrite(...) end
  15. function sp(...) return textutils.slowPrint(...) end
  16.  
  17. function newGame()
  18. Cookies = "0"
  19. cps = "1"
  20. ClickerCost = "10"
  21. end
  22.  
  23.  
  24. sbc( colors.black )
  25. term.clear()
  26. sbc( colors.gray )
  27. scp(6,6)
  28. w([[New File Or Import? ]])
  29. sbc( colors.white )
  30. scp(6,7)
  31. w([[ ]])
  32. scp(6,8)
  33. w([[ Do you want to import a save or ]])
  34. scp(6,9)
  35. w([[ create a new file? ]])
  36. scp(6,10)
  37. w([[ ]])
  38. scp(6,11)
  39. w([[ ]])
  40. scp(6,12)
  41. w([[ ]])
  42. scp(8,11)
  43. sbc( colors.red )
  44. stc(1)
  45. w([[ New ]])
  46. while true do
  47.  
  48. event, button, X, Y = os.pullEvent("mouse_click")
  49.  
  50. if X >= 8 and X <= 13 and Y == 11 then
  51. newGame()
  52. break
  53. end
  54. end
  55.  
  56.  
  57. sbc( colors.cyan )
  58. term.clear()
  59.  
  60. function drawCookie()
  61. paintutils.drawImage(Cookie, 3, 3 )
  62. end
  63.  
  64. function drawAmmount()
  65. stc(1)
  66. sbc( colors.cyan )
  67. scp(2,16)
  68. print(Cookies.." Cookies")
  69. end
  70.  
  71. function drawShop()
  72. paintutils.drawFilledBox(30, 3, 50, 6, colors.orange)
  73. scp(32,4)
  74. stc(1)
  75. w([[ Clicker ]])
  76. scp(32,5)
  77. if Cookies >= ClickerCost then
  78. stc( colors.green )
  79. term.write(ClickerCost.." Cookies")
  80. else
  81. stc( colors.red )
  82. scp(32,5)
  83. term.write(ClickerCost.." Cookies")-
  84. end
  85. end
  86.  
  87.  
  88.  
  89. -- Game Startup
  90.  
  91.  
  92.  
  93. drawShop()
  94. drawAmmount()
  95. drawCookie()
  96.  
  97. while true do
  98.  
  99. event, button, X, Y = os.pullEvent("mouse_click")
  100. if X >= 4 and X <= 18 and Y == 3 or X >= 4 and X <= 18 and Y == 4 or X >= 4 and X <= 18 and Y == 5 or X >= 4 and X <= 18 and Y == 6 or X >= 4 and X <= 18 and Y == 7 or X >= 4 and X <= 18 and Y == 8 or X >= 4 and X <= 18 and Y == 9 or X >= 4 and X <= 18 and Y == 10 or X >= 4 and X <= 18 and Y == 11 or X >= 4 and X <= 18 and Y == 12 then
  101. Cookies = Cookies + cps
  102. drawAmmount()
  103. drawShop()
  104. end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment