Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w, mapa= {}, '<C><P/><Z><S><S P="0,0,0.3,0.2,0,0,0,0"L="720"X="400"H="200"Y="480"T="0"/></S><D><DS Y="365"X="400"/></D><O/></Z></C>';
- table.foreach({string,math,table,tfm.exec,system,ui}, function(num,libs) for i,v in pairs(libs) do _G[i]= v; end end)
- foreach({'AfkDeath','AutoScore','AutoShaman','AutoNewGame','AutoTimeLeft'}, function(n,v) _G['disable'..v](true) end)
- eventMessage= function(i)
- return g and i or addTextArea(1, eventWinners(), nil,103,21,590,nil,1,1,1) or i;
- end
- eventNewPlayer= function(p)
- w[p]= bindKeyboard(p,17,true) or bindKeyboard(p,17,false) or w[p] or 0;
- end
- eventNewGame= function()
- g, tb, cn, tM= false, removeTextArea(1) or {}, setGameTime(180) or false, setMapName(char(35,100,111,100,103,101)) or 0;
- end
- eventKeyboard= function(p,id,dw)
- ({t= function() addTextArea(2, eventRanking(), p, 50, 70) end; f= function() removeTextArea(2,p) end})[tostring(dw):sub(0,1)]()
- end
- eventRanking= function()
- local l, txt, r= {}, '<n>%02d. <v>%s<n><j>%s', '<font face="Lucida Console"><r>##. Jogador Vitórias\n';
- a= foreach(tfm.get.room.playerList, function(i,v) l[#l +1]= {s=w[i], n=i}; end) or sort(l, function(a,b) return a.s > b.s; end);
- return foreach(l, function(i,v) r= i < 11 and r..'\n'..txt:format(i, v.n..(' '):rep(14 -#v.n), v.s) or r; end) or r;
- end
- eventPlayerDied= function(p)
- v= 0; foreach(tfm.get.room.playerList, function(i,p) v= p.isDead == false and v +1 or v; end)
- v= v == 1 and eventMessage(v) or v == 0 and eventLoop(0,0);
- end
- eventLoop= function(a,b)
- tM= not tM and 1/2 or tM +1/2;
- tM= tM == 175 and eventMessage(tM) or (tM == 180 or b <= 0) and newGame(mapa) or tM;
- cn= tM == 5 and true or cn and addShamanObject(17, 801, random(100,375), random(-135,-30)) or cn;
- end
- eventWinners= function()
- str, cn, g= setGameTime(4) or '<j><p align="center"><font face="Lucida Console" size="20">%s: <v>%s', false, true;
- foreach(tfm.get.room.playerList, function(p,c) t= not c.isDead; tb[#tb +1], w[p]= t and p or nil, t and w[p] +1 or w[p]; end)
- return str:format(char(86,101,110,99,101,100,111,114)..(#tb > 1 and char(101,115) or ''), concat(tb, '<j>, <v>')..'<j>!');
- end
- main= eventLoop(0,0) or foreach(tfm.get.room.playerList, eventNewPlayer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement