Advertisement
poulton0

main.lua

Dec 18th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.07 KB | None | 0 0
  1. require "table"
  2. require "string"
  3. ver="0.6.4"
  4. t = {}
  5. os.execute("cls")
  6.  
  7. local clock = os.clock
  8. function sleep(n) -- seconds
  9. local t0 = clock()
  10. while clock() - t0 <= n do end
  11. end
  12.  
  13.  
  14.  
  15.  
  16. function value()
  17. pointers=0
  18. files=0
  19. humans=0
  20. macros=0
  21. bots=0
  22. rnds=100
  23. a=10
  24. b=1000
  25. c=100000
  26. d=10000000
  27. e=1000000000
  28. f=110
  29. g=10
  30. clicks=0
  31. cheat=2147483647
  32. name=""
  33. end
  34.  
  35. function load_file()
  36. dofile( "table.save-1.0.lua" )
  37. local t1 = table.load( "save.dat" )
  38. clicks=t1[1]
  39. pointers=t1[2]
  40. files=t1[3]
  41. humans=t1[4]
  42. macros=t1[5]
  43. bots=t1[6]
  44. rnds=t1[7]
  45. a=t1[8]
  46. b=t1[9]
  47. c=t1[10]
  48. d=t1[11]
  49. e=t1[12]
  50. f=t1[13]
  51. end
  52.  
  53.  
  54.  
  55. function save_game()
  56. dofile( "table.save-1.0.lua" )
  57. table.insert(t, 1, clicks)
  58. table.insert(t, 2, pointers)
  59. table.insert(t, 3, files)
  60. table.insert(t, 4, humans)
  61. table.insert(t, 5, macros)
  62. table.insert(t, 6, bots)
  63. table.insert(t, 7, rnds)
  64. table.insert(t, 8, a)
  65. table.insert(t, 9, b)
  66. table.insert(t, 10, c)
  67. table.insert(t, 11, d)
  68. table.insert(t, 12, e)
  69. table.insert(t, 13, f)
  70. assert( table.save( t, "save.dat" ) == 1 )
  71. end
  72.  
  73. function credits()
  74. os.execute("lua credits.lua")
  75. main()
  76. end
  77.  
  78. function rand()
  79. os.execute("sounder click.wav")
  80. clicks=clicks-rnds
  81. rnds=rnds+100
  82. rnd=math.random(1,10000)
  83. if rnd == 100 then
  84. humans=humans+1
  85. elseif rnd == 1000 then
  86. macros=macros+1
  87. elseif rnd == 10000 then
  88. bots=bots+1
  89. else
  90. print("unlucky")
  91. sleep(0.5)
  92. end
  93. end
  94.  
  95.  
  96. function name_set()
  97. if name=="HAXOR" then
  98. print("ERROR YOU CAN'T CHANGE YOUR NAME")
  99. main()
  100. end
  101. os.execute("cls")
  102. print("do you want to change your name yes/no")
  103. reed=io.read()
  104. if reed=="yes" then
  105. print("enter a new name")
  106. name=io.read()
  107. main()
  108. elseif reed == "no" then
  109. main()
  110. elseif reed == "" then
  111. print("error no option entered")
  112. sleep(0.5)
  113. name_set()
  114. end
  115. end
  116.  
  117. function pointer_s()
  118. if clicks >= a then
  119. os.execute("sounder click.wav")
  120. pointers=pointers+1
  121. clicks=clicks-a
  122. a=a+7
  123. click()
  124. else
  125. print("Not enough clicks")
  126. end
  127. end
  128.  
  129. function batch_s()
  130. if clicks >= b then
  131. os.execute("sounder click.wav")
  132. files=files+1
  133. clicks=clicks-b
  134. b=b+700
  135. click()
  136. else
  137. print("Not enough clicks")
  138. end
  139. end
  140.  
  141. function human_s()
  142. if clicks >= c then
  143. os.execute("sounder click.wav")
  144. humans=humans+1
  145. clicks=clicks-c
  146. c=c+70000
  147. click()
  148. else
  149. print("Not enough clicks")
  150. end
  151. end
  152.  
  153. function macro_s()
  154. if clicks >= d then
  155. os.execute("sounder click.wav")
  156. macros=macros+1
  157. clicks=clicks-d
  158. d=d+7000000
  159. click()
  160. else
  161. print("Not enough clicks")
  162. end
  163. end
  164.  
  165. function bot_s()
  166. if clicks >= e then
  167. os.execute("sounder click.wav")
  168. bots=bots+1
  169. clicks=clicks-e
  170. e=e+700000000
  171. click()
  172. else
  173. print("Not enough clicks")
  174. end
  175. end
  176.  
  177.  
  178. function help()
  179. os.execute("cls")
  180. print(" ? = this menu")
  181. print(" point = buy a pointer")
  182. print(" bfile = buy a batch file")
  183. print(" human = buy a human")
  184. print(" macro = buy a macro")
  185. print(" btnet = buy a bot net")
  186. print(" rando = buy a random chance")
  187. print(" name = change name")
  188. print("credit = show credits")
  189. print(" save = save game")
  190. print(" load = load game")
  191. print(" quit = quit/save game")
  192. print("")
  193. print("press enter to continue")
  194. yn=io.read()
  195. if yn == "" then
  196. main()
  197. else
  198. help()
  199. end
  200. end
  201.  
  202.  
  203.  
  204. function welcome()
  205. sleep(0.5)
  206. print("what is your name")
  207. sleep(0.5)
  208. name = io.read()
  209. if name =="HAXOR" then
  210. print("YOU CANT HAVE THAT NAME")
  211. welcome()
  212. end
  213. sleep(0.5)
  214. if name == "CH34T" then
  215. print("YOU HAXOR")
  216. name="HAXOR"
  217. sleep(0.5)
  218. clicks=cheat
  219. pointers=cheat
  220. files=cheat
  221. humans=cheat
  222. macros=cheat
  223. bots=cheat
  224. end
  225. if name=="jason" or name == "Jason" then
  226. os.execute("color c")
  227. end
  228. if name=="zophie" or name == "Zophie" then
  229. os.execute("color c")
  230. end
  231. if name=="misfit" or name=="Misfit" then
  232. os.execute("color e")
  233. end
  234. if name=="fobs" or name=="Fobs" then
  235. os.execute("color 0")
  236. end
  237. if name=="sierra" or naem=="Sierra" then
  238. os.execute("color d")
  239. end
  240. if name=="sam" or "Sam" then
  241. os.execute("color 1")
  242. print("hello "..name.." and welcome to batch clicker (lua) ver: "..ver)
  243. sleep(2)
  244. print("to see a list of commands type ?")
  245. sleep(5)
  246. end
  247. end
  248.  
  249. function click()
  250. os.execute("cls")
  251. print("Current clicks: "..clicks.." Player: "..name)
  252. print("Current pointers: "..pointers.." Current pointer price: "..a)
  253. print("Current batch files: "..files.." Current batch file price: "..b)
  254. print("Current humans: "..humans.." Current human price: "..c)
  255. print("Current macros: "..macros.." Current current macro price: "..d)
  256. print("Current bot nets: "..bots.." current current bot net price: "..e)
  257. print("Random = "..rnds.." clicks")
  258. clicks=(clicks+1)+(pointers*2)+(files*4)+(humans*8)+(macros*16)+(bots*32)
  259. main()
  260. end
  261.  
  262. function quit()
  263. save_game()
  264. os.exit()
  265. end
  266.  
  267. function main()
  268. while true do
  269. check=io.read()
  270.  
  271. if check == "?" then
  272. help()
  273. end
  274.  
  275. if check == "" then
  276. click()
  277. end
  278.  
  279. if check == "-" then
  280. click()
  281. end
  282.  
  283. if check == "point" then
  284. pointer_s()
  285. end
  286.  
  287. if check == "bfile" then
  288. batch_s()
  289. end
  290.  
  291. if check == "human" then
  292. human_s()
  293. end
  294.  
  295. if check == "macro" then
  296. macro_s()
  297. end
  298.  
  299. if check == "btnet" then
  300. bot_s()
  301. end
  302.  
  303. if check == "c_h_e_a_t" and name == "HAXOR" then
  304. clicks=clicks+(cheat*1000000)
  305. pointers=pointers+(cheat*1000000)
  306. files=files+(cheat*1000000)
  307. humans=humans+(cheat*1000000)
  308. macros=macros+(cheat*1000000)
  309. bots=bots+(cheat*1000000)
  310. click()
  311. end
  312.  
  313. if check == "name" then
  314. name_set()
  315. end
  316.  
  317. if check == "rando" and clicks >= rnds then
  318. rand()
  319. end
  320.  
  321. if check == "credit" then
  322. credits()
  323. end
  324.  
  325. if check == "save" then
  326. save_game()
  327. end
  328.  
  329. if check == "load" then
  330. load_file()
  331. end
  332.  
  333. if check == "quit" then
  334. quit()
  335. end
  336.  
  337. end
  338. end
  339. value()
  340. welcome()
  341. os.execute("cls")
  342. print("Current clicks: "..clicks.." Player: "..name)
  343. print("Current pointers: "..pointers.." Current pointer price: "..a)
  344. print("Current batch files: "..files.." Current batch file price: "..b)
  345. print("Current humans: "..humans.." Current human price: "..c)
  346. print("Current macros: "..macros.." Current current macro price: "..d)
  347. print("Current bot nets: "..bots.." Current current bot net price: "..e)
  348. print("Random = "..rnds.." clicks")
  349. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement