Advertisement
Robonado

#dodge

Aug 2nd, 2015
3,628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.24 KB | None | 0 0
  1. 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>';
  2.  
  3. table.foreach({string,math,table,tfm.exec,system,ui}, function(num,libs) for i,v in pairs(libs) do _G[i]= v; end end)
  4. foreach({'AfkDeath','AutoScore','AutoShaman','AutoNewGame','AutoTimeLeft'}, function(n,v) _G['disable'..v](true) end)
  5.  
  6. eventMessage= function(i)
  7.     return g and i or addTextArea(1, eventWinners(), nil,103,21,590,nil,1,1,1) or i;
  8. end
  9.  
  10. eventNewPlayer= function(p)
  11.     w[p]= bindKeyboard(p,17,true) or bindKeyboard(p,17,false) or w[p] or 0;
  12. end
  13.  
  14. eventNewGame= function()
  15.     g, tb, cn, tM= false, removeTextArea(1) or {}, setGameTime(180) or false, setMapName(char(35,100,111,100,103,101)) or 0;
  16. end
  17.  
  18. eventKeyboard= function(p,id,dw)
  19.     ({t= function() addTextArea(2, eventRanking(), p, 50, 70) end; f= function() removeTextArea(2,p) end})[tostring(dw):sub(0,1)]()
  20. end
  21.  
  22. eventRanking= function()
  23.     local l, txt, r= {}, '<n>%02d. <v>%s<n><j>%s', '<font face="Lucida Console"><r>##. Jogador       Vitórias\n';
  24.     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);
  25.     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;
  26. end
  27.  
  28. eventPlayerDied= function(p)
  29.     v= 0; foreach(tfm.get.room.playerList, function(i,p) v= p.isDead == false and v +1 or v; end)
  30.     v= v == 1 and eventMessage(v) or v == 0 and eventLoop(0,0);
  31. end
  32.  
  33. eventLoop= function(a,b)
  34.     tM= not tM and 1/2 or tM +1/2;
  35.     tM= tM == 175 and eventMessage(tM) or (tM == 180 or b <= 0) and newGame(mapa) or tM;
  36.     cn= tM == 5 and true or cn and addShamanObject(17, 801, random(100,375), random(-135,-30)) or cn;
  37. end
  38.  
  39. eventWinners= function()
  40.     str, cn, g= setGameTime(4) or '<j><p align="center"><font face="Lucida Console" size="20">%s: <v>%s', false, true;
  41.     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)
  42.     return str:format(char(86,101,110,99,101,100,111,114)..(#tb > 1 and char(101,115) or ''), concat(tb, '<j>, <v>')..'<j>!');
  43. end
  44.  
  45. main= eventLoop(0,0) or foreach(tfm.get.room.playerList, eventNewPlayer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement