Advertisement
Guest User

Script de cookie clicker

a guest
Aug 19th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.99 KB | None | 0 0
  1.  
  2. data={};
  3. mg={
  4. ["cookies"]=0;
  5. ["gc"]=0;
  6. ["tgc"]=os.time();
  7. ["ck"]=1;
  8. ["clk"]=0;
  9. ["gc"]=0;
  10. ["cursor"]=0;
  11. ["grandma"]=0;
  12. ["farm"]=0;
  13. ["factory"]=0;
  14. ["mine"]=0;
  15. ["shipment"]=0;
  16. ["alchemylab"]=0;
  17. ["portal"]=0;
  18. ["timemachine"]=0;
  19. ["antimatter"]=0;
  20. ["s"]=100;
  21. ["ts"]=os.time();
  22. ["sm"]=0;
  23. ["pc"]=0;
  24. ["com"]="";
  25. };
  26. com={
  27. ["c1"]=20;
  28. ["c2"]=100;
  29. ["c3"]=500;
  30. ["c4"]=3000;
  31. ["c5"]=10000;
  32. ["c6"]=40000;
  33. ["c7"]=200000;
  34. ["c8"]=1667667;
  35. ["c9"]=123456789;
  36. ["c10"]=3999999999
  37. };
  38. den={
  39. x1={30,30,30,40,40,40,50,50,60,40,50,50,60,70,70,80,80,90,90,90,80,80,70,70,70,60,60,50,40,50,50,60,60,70,80,70,60,50,70,60};
  40. y1={310,320,330,330,310,300,300,290,290,340,340,350,350,350,340,340,330,330,320,310,310,300,300,290,310,310,300,310,320,320,330,340,330,330,320,320,320,320,310,330};
  41. cor1={'0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x000000','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x65371A','0x47231C','0x47231C','0x47231C'};
  42. ids1={1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040};
  43. };
  44. -- Outras tables
  45. ckids={};
  46. idd=0;
  47. gn=0;
  48. prm={};
  49. -- Functions
  50. function gText(id,p,x,y)
  51. if id == 1 then
  52. ui.addTextArea(1,"<font size='18' face='Comic Sans MS'>"..math.floor(mg.cookies).." Cookies",NIL,100,50,NIL,NIL,1,1,0.3)
  53. ui.addTextArea(17,"<TI><a href='event:help'><p align='center'>?",NIL,30,20,18,18,0x3C5064,0x27373F,1,true)
  54. end
  55. if id == 2 then
  56. mg.s=mg.s+1;
  57. table.insert(ckids,mg.s)
  58. ui.addTextArea(mg.s,"<font size='18' face='Comic Sans MS'>+"..mg.ck.."",NIL,x,y-5,NIL,0,0,0)
  59. mg.cookies=mg.cookies+mg.ck;
  60. gText(1)
  61. end
  62. if id == 3 then
  63. ui.addTextArea(2,"<font size='12' face='Comic Sans MS'>Cursor | <a href='event:cursor'>Comprar: <J>"..math.floor(com.c1).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..math.floor(mg.cursor).."",NIL,424,38,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  64. end
  65. if id == 4 then
  66. ui.addTextArea(3,"<font size='12' face='Comic Sans MS'>Grandma | <a href='event:grandma'>Comprar: <J>"..math.floor(com.c2).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..math.floor(mg.grandma).."",NIL,424,108,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  67. end
  68. if id == 5 then
  69. ui.addTextArea(4,"<font size='12' face='Comic Sans MS'>Fazenda | <a href='event:farm'>Comprar: <J>"..math.floor(com.c3).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..math.floor(mg.farm).."",NIL,424,178,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  70. end
  71. if id == 6 then
  72. ui.addTextArea(5,"<font size='12' face='Comic Sans MS'>Fábrica | <a href='event:factory'>Comprar: <J>"..math.floor(com.c4).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..math.floor(mg.factory).."",NIL,424,248,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  73. end
  74. if id == 7 then
  75. ui.addTextArea(6,"<font size='12' face='Comic Sans MS'>Mina | <a href='event:mine'>Comprar: <J>"..math.floor(com.c5).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..math.floor(mg.mine).."",NIL,424,318,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  76. end
  77. if id == 8 then
  78. ui.addTextArea(7,"<font size='12' face='Comic Sans MS'>Nave | <a href='event:shipment'>Comprar: <J>"..math.floor(com.c6).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..mg.shipment.."",NIL,850,38,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  79. end
  80. if id == 10 then
  81. ui.addTextArea(8,"<font size='12' face='Comic Sans MS'>Laboratório Alquimico | <a href='event:alchemylab'>Comprar: <J>"..math.floor(com.c7).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..mg.alchemylab.."",NIL,850,178,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  82. end
  83. if id == 11 then
  84. ui.addTextArea(9,"<font size='12' face='Comic Sans MS'>Portal | <a href='event:portal'>Comprar: <J>"..math.floor(com.c8).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..mg.portal.."",NIL,850,248,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  85. end
  86. if id == 12 then
  87. ui.addTextArea(10,"<font size='12' face='Comic Sans MS'>Máquina do tempo | <a href='event:timemachine'>Comprar: <J>"..math.floor(com.c9).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..mg.timemachine.."",NIL,850,318,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  88. end
  89. if id == 13 then
  90. ui.addTextArea(11,"<font size='12' face='Comic Sans MS'>Convertor de anti-matéria | <a href='event:antimatter'>Comprar: <J>"..math.floor(com.c10).." Cookies</a><N><J><br /><N>Quantidade atual:<VP> "..mg.antimatter.."",NIL,850,108,200,NIL,0xB5B1A5,0x3D3A2B,0.3)
  91. end
  92. if id == 14 then
  93. ui.addTextArea(12,"<V><TI>Ajuda - Cookie Clicker",p,75,100,650,100,0x27373F,0x27373F,1,true)
  94. ui.addTextArea(13,"<br /><br /><TI>Bem vindo ao cookie clicker, seu objetivo é dominar o mundo de cookies! :)<br />Aperte no cookie e gere mais cookies para o seu grande imperio de biscoitos ou compre uma fábrica para gerar cookies automaticamente!!!<br />Compre upgrades para fazer melhorias no jogo e ganhar ainda mais cookies.<br />Jogue com seus amigos ou sozinho.<br />Fale <V>!salvar<N> para poder guardar o estado atual do seu grande imperio de biscoitos.",p,75,130,650,250,0x324650,0x27373F,1,true)
  95. ui.addTextArea(14,"<p align='center'><font color='#27373F'><B><a href='event:close'>X</a>",p,705,100,15,16,0x009D9D,0x27373F,1,true)
  96. ui.addTextArea(15,"<p align='center'><VP>Ajuda",p,80,135,150,15,0x3C5064,0x27373F,1,true)
  97. ui.addTextArea(16,"<p align='center'><a href='event:stats'>Estatísticas",p,260,135,150,15,0x3C5064,0x27373F,1,true)
  98. end
  99. if id == 15 then
  100. ui.addTextArea(12,"<V><TI>Estatísticas - Cookie Clicker",p,75,100,650,100,0x27373F,0x27373F,1,true)
  101. ui.addTextArea(13,"<br /><br /><TI>Quantidade de vezes clicada no cookie : <V>"..mg.clk.."<br /><N>Tempo em segundos que você está jogando : <V>"..mg.sm.."<br /><N>Cookies por segundo : <V>"..math.floor(mg.gc).."",p,75,130,650,250,0x324650,0x27373F,1,true)
  102. ui.addTextArea(14,"<p align='center'><font color='#27373F'><B><a href='event:close'>X</a>",p,705,100,15,16,0x009D9D,0x27373F,1,true)
  103. ui.addTextArea(15,"<p align='center'><a href='event:help'>Ajuda",p,80,135,150,15,0x3C5064,0x27373F,1,true)
  104. ui.addTextArea(16,"<p align='center'><VP>Estatísticas",p,260,135,150,15,0x3C5064,0x27373F,1,true)
  105. end
  106. if id == 16 then
  107. ui.addTextArea(18,"<V><TI>Ultimas compras :<font size='12'><N>"..mg.com.."",NIL,1158,50,400,NIL,0.0,0)
  108. end
  109. end
  110. function f5table(prd,pr,p)
  111. x="<br /><J>["..p.."] <N>Comprou <VP>"..prd.."<N> por <CH>"..math.floor(pr).." cookies!";
  112. if #prm <= 19 then
  113. table.insert(prm,x)
  114. mg.com=mg.com..""..x.."";
  115. else
  116. table.remove(prm,1)
  117. table.insert(prm,x)
  118. mg.com="";
  119. for i,v in pairs(prm) do
  120. mg.com=mg.com..""..v.."";
  121. end
  122. end
  123. gText(16)
  124. end
  125. function buy(id,prd,c,player)
  126. if mg.cookies >= com[c] then
  127. f5table(prd,com[c],player)
  128. mg.cookies=mg.cookies-com[c];
  129. mg[prd]=mg[prd]+1;
  130. com[c]=com[c]+com[c];
  131. gn=com[c];
  132. mg.gc=mg.gc+gn/500;
  133. end
  134. for i = 3,13 do
  135. gText(i)
  136. end
  137. gText(1)
  138. tfm.exec.setUIMapName("<N>Cookies por segundo : <J>"..math.floor(mg.gc).."")
  139. end
  140. function giveData(p)
  141. if not data[p] then
  142. nD={
  143. ["time"]=os.time();
  144. };
  145. data[p] = nD;
  146. end
  147. system.bindMouse(p,true)
  148. for i = 3,14 do
  149. gText(i,p,0,0)
  150. end
  151. gText(1)
  152. end
  153. -- Inicio do script
  154. for i in pairs(tfm.get.room.playerList) do
  155. giveData(i)
  156. end
  157. tfm.exec.disableAutoNewGame(true)
  158. tfm.exec.disableAutoShaman(true)
  159. tfm.exec.disableAfkDeath(true)
  160. tfm.exec.newGame(4721074)
  161. system.bindMouse("Brenower",true)
  162. function eventMouse(player,x,y)
  163. if x >= 45 and x <= 249 and y >= 98 and y <= 294 then
  164. if data[player].time < os.time()-150 then
  165. gText(2,player,x,y)
  166. data[player].time=os.time();
  167. mg.clk=mg.clk+1;
  168. tfm.exec.displayParticle(29,x,y,-1,-2,0,0,NIL)
  169. tfm.exec.displayParticle(29,x,y,-3,2,0,0,NIL)
  170. tfm.exec.displayParticle(29,x,y,1,-2,0,0,NIL)
  171. tfm.exec.displayParticle(29,x,y,3,2,0,0,NIL)
  172. end
  173. end
  174. if x >= 30 and x <= 70 and y >= 290 and y <= 350 and mg.gc == 1 then
  175. mg.cookies=mg.cookies*2;
  176. mg.gc=0;
  177. for i = #den.x1,1,-1 do
  178. ui.removeTextArea(den.ids1[i],nil)
  179. end
  180. end
  181. end
  182. -- Loop
  183. function eventLoop()
  184. mg.sm=mg.sm+0.5;
  185. if #ckids >= 1 then
  186. ui.removeTextArea(ckids[1],NIL)
  187. table.remove(ckids,1)
  188. end
  189. if mg.ts < os.time()-1500 then
  190. mg.cookies=mg.cookies+mg.gc;
  191. gText(1)
  192. end
  193. if mg.tgc < os.time()-90000 and mg.gc == 0 then
  194. mg.gc=1;
  195. mg.tgc=os.time();
  196. for i = #den.x1,1,-1 do
  197. ui.addTextArea(den.ids1[i],"<font color='#"..string.sub(den.cor1[i],3).."'><font size='13'>■",nil,den.x1[i],den.y1[i],nil,nil,0,0,0)
  198. end
  199. end
  200. end
  201. -- Novo jogador entra na sala
  202. function eventNewPlayer(p)
  203. giveData(p)
  204. tfm.exec.respawnPlayer(p)
  205. end
  206. -- Callbacks
  207. function eventTextAreaCallback(id,player,link)
  208. if link == [[close]] then
  209. for i = 12,16 do
  210. ui.removeTextArea(i,player)
  211. end
  212. end
  213. if link == [[help]] then
  214. gText(14,player)
  215. end
  216. if link == [[stats]] then
  217. gText(15,player)
  218. end
  219. if link ~= [[close]] and link ~= [[help]] and link ~= [[stats]] then
  220. idd=id;
  221. idd=idd-1;
  222. buy(idd,""..link.."","c"..idd.."",player)
  223. end
  224. end
  225. -- Comandos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement