Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data={};
- mg={
- ["cookies"]=0;
- ["gc"]=0;
- ["tgc"]=os.time();
- ["ck"]=1;
- ["clk"]=0;
- ["gc"]=0;
- ["cursor"]=0;
- ["grandma"]=0;
- ["farm"]=0;
- ["factory"]=0;
- ["mine"]=0;
- ["shipment"]=0;
- ["alchemylab"]=0;
- ["portal"]=0;
- ["timemachine"]=0;
- ["antimatter"]=0;
- ["s"]=100;
- ["ts"]=os.time();
- ["sm"]=0;
- ["pc"]=0;
- ["com"]="";
- };
- com={
- ["c1"]=20;
- ["c2"]=100;
- ["c3"]=500;
- ["c4"]=3000;
- ["c5"]=10000;
- ["c6"]=40000;
- ["c7"]=200000;
- ["c8"]=1667667;
- ["c9"]=123456789;
- ["c10"]=3999999999
- };
- den={
- 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};
- 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};
- 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'};
- 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};
- };
- -- Outras tables
- ckids={};
- idd=0;
- gn=0;
- prm={};
- -- Functions
- function gText(id,p,x,y)
- if id == 1 then
- ui.addTextArea(1,"<font size='18' face='Comic Sans MS'>"..math.floor(mg.cookies).." Cookies",NIL,100,50,NIL,NIL,1,1,0.3)
- ui.addTextArea(17,"<TI><a href='event:help'><p align='center'>?",NIL,30,20,18,18,0x3C5064,0x27373F,1,true)
- end
- if id == 2 then
- mg.s=mg.s+1;
- table.insert(ckids,mg.s)
- ui.addTextArea(mg.s,"<font size='18' face='Comic Sans MS'>+"..mg.ck.."",NIL,x,y-5,NIL,0,0,0)
- mg.cookies=mg.cookies+mg.ck;
- gText(1)
- end
- if id == 3 then
- 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)
- end
- if id == 4 then
- 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)
- end
- if id == 5 then
- 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)
- end
- if id == 6 then
- 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)
- end
- if id == 7 then
- 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)
- end
- if id == 8 then
- 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)
- end
- if id == 10 then
- 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)
- end
- if id == 11 then
- 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)
- end
- if id == 12 then
- 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)
- end
- if id == 13 then
- 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)
- end
- if id == 14 then
- ui.addTextArea(12,"<V><TI>Ajuda - Cookie Clicker",p,75,100,650,100,0x27373F,0x27373F,1,true)
- 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)
- 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)
- ui.addTextArea(15,"<p align='center'><VP>Ajuda",p,80,135,150,15,0x3C5064,0x27373F,1,true)
- ui.addTextArea(16,"<p align='center'><a href='event:stats'>Estatísticas",p,260,135,150,15,0x3C5064,0x27373F,1,true)
- end
- if id == 15 then
- ui.addTextArea(12,"<V><TI>Estatísticas - Cookie Clicker",p,75,100,650,100,0x27373F,0x27373F,1,true)
- 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)
- 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)
- ui.addTextArea(15,"<p align='center'><a href='event:help'>Ajuda",p,80,135,150,15,0x3C5064,0x27373F,1,true)
- ui.addTextArea(16,"<p align='center'><VP>Estatísticas",p,260,135,150,15,0x3C5064,0x27373F,1,true)
- end
- if id == 16 then
- ui.addTextArea(18,"<V><TI>Ultimas compras :<font size='12'><N>"..mg.com.."",NIL,1158,50,400,NIL,0.0,0)
- end
- end
- function f5table(prd,pr,p)
- x="<br /><J>["..p.."] <N>Comprou <VP>"..prd.."<N> por <CH>"..math.floor(pr).." cookies!";
- if #prm <= 19 then
- table.insert(prm,x)
- mg.com=mg.com..""..x.."";
- else
- table.remove(prm,1)
- table.insert(prm,x)
- mg.com="";
- for i,v in pairs(prm) do
- mg.com=mg.com..""..v.."";
- end
- end
- gText(16)
- end
- function buy(id,prd,c,player)
- if mg.cookies >= com[c] then
- f5table(prd,com[c],player)
- mg.cookies=mg.cookies-com[c];
- mg[prd]=mg[prd]+1;
- com[c]=com[c]+com[c];
- gn=com[c];
- mg.gc=mg.gc+gn/500;
- end
- for i = 3,13 do
- gText(i)
- end
- gText(1)
- tfm.exec.setUIMapName("<N>Cookies por segundo : <J>"..math.floor(mg.gc).."")
- end
- function giveData(p)
- if not data[p] then
- nD={
- ["time"]=os.time();
- };
- data[p] = nD;
- end
- system.bindMouse(p,true)
- for i = 3,14 do
- gText(i,p,0,0)
- end
- gText(1)
- end
- -- Inicio do script
- for i in pairs(tfm.get.room.playerList) do
- giveData(i)
- end
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.newGame(4721074)
- system.bindMouse("Brenower",true)
- function eventMouse(player,x,y)
- if x >= 45 and x <= 249 and y >= 98 and y <= 294 then
- if data[player].time < os.time()-150 then
- gText(2,player,x,y)
- data[player].time=os.time();
- mg.clk=mg.clk+1;
- tfm.exec.displayParticle(29,x,y,-1,-2,0,0,NIL)
- tfm.exec.displayParticle(29,x,y,-3,2,0,0,NIL)
- tfm.exec.displayParticle(29,x,y,1,-2,0,0,NIL)
- tfm.exec.displayParticle(29,x,y,3,2,0,0,NIL)
- end
- end
- if x >= 30 and x <= 70 and y >= 290 and y <= 350 and mg.gc == 1 then
- mg.cookies=mg.cookies*2;
- mg.gc=0;
- for i = #den.x1,1,-1 do
- ui.removeTextArea(den.ids1[i],nil)
- end
- end
- end
- -- Loop
- function eventLoop()
- mg.sm=mg.sm+0.5;
- if #ckids >= 1 then
- ui.removeTextArea(ckids[1],NIL)
- table.remove(ckids,1)
- end
- if mg.ts < os.time()-1500 then
- mg.cookies=mg.cookies+mg.gc;
- gText(1)
- end
- if mg.tgc < os.time()-90000 and mg.gc == 0 then
- mg.gc=1;
- mg.tgc=os.time();
- for i = #den.x1,1,-1 do
- 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)
- end
- end
- end
- -- Novo jogador entra na sala
- function eventNewPlayer(p)
- giveData(p)
- tfm.exec.respawnPlayer(p)
- end
- -- Callbacks
- function eventTextAreaCallback(id,player,link)
- if link == [[close]] then
- for i = 12,16 do
- ui.removeTextArea(i,player)
- end
- end
- if link == [[help]] then
- gText(14,player)
- end
- if link == [[stats]] then
- gText(15,player)
- end
- if link ~= [[close]] and link ~= [[help]] and link ~= [[stats]] then
- idd=id;
- idd=idd-1;
- buy(idd,""..link.."","c"..idd.."",player)
- end
- end
- -- Comandos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement