Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data = {}
- local gametime = 5
- local xml = '<C><P /><Z><S><S L="800" X="401" H="127" Y="432" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /><L><VL n="Layer1" l="-1" /><JPL c="050505,9,1,0" P3="42,316" P2="44,311" P4="43,314" P1="42,317" /><JPL c="050505,9,1,0" P3="46,307" P2="52,296" P4="49,302" P1="44,311" /><JPL c="050505,9,1,0" P3="56,289" P2="65,276" P4="60,283" P1="52,296" /><JPL c="050505,9,1,0" P3="71,269" P2="84,256" P4="77,263" P1="65,276" /><JPL c="050505,9,1,0" P3="92,250" P2="110,241" P4="100,245" P1="84,256" /><JPL c="050505,9,1,0" P3="120,238" P2="142,235" P4="130,236" P1="110,241" /><JPL c="050505,9,1,0" P3="155,236" P2="155,236" P4="168,238" P1="142,235" /><VC f="20" P2="168,238" C1="42,317" C="050505,9,1,0" C2="76,216" P1="42,317" /><JPL c="050505,9,1,0" P3="168,162" P2="159,165" P4="164,163" P1="169,162" /><JPL c="050505,9,1,0" P3="152,167" P2="134,174" P4="144,170" P1="159,165" /><JPL c="050505,9,1,0" P3="124,179" P2="102,190" P4="113,184" P1="134,174" /><JPL c="050505,9,1,0" P3="91,197" P2="70,214" P4="80,205" P1="102,190" /><JPL c="050505,9,1,0" P3="61,223" P2="45,246" P4="52,234" P1="70,214" /><JPL c="050505,9,1,0" P3="40,258" P2="36,286" P4="37,272" P1="45,246" /><JPL c="050505,9,1,0" P3="37,302" P2="37,302" P4="41,319" P1="36,286" /><VC f="20" P2="41,319" C1="169,162" C="050505,9,1,0" C2="4,203" P1="169,162" /><JD c="050505,9,1,0" P2="170,273" P1="169,238" /><JD c="050505,9,1,0" P2="301,203" P1="170,273" /><JD c="050505,9,1,0" P2="170,123" P1="300,202" /><JD c="050505,9,1,0" P2="170,159" P1="170,123" /><JD c="050505,9,1,0" P2="50,244" P1="42,299" /><JD c="050505,9,1,0" P2="73,243" P1="43,304" /><JD c="050505,36,1,0" P2="102,216" P1="57,258" /><JD c="050505,36,1,0" P2="168,181" P1="102,216" /><JD c="050505,36,1,0" P2="75,228" P1="168,181" /><JD c="050505,36,1,0" P2="173,197" P1="105,229" /><JD c="050505,36,1,0" P2="186,220" P1="130,221" /><JD c="050505,28,1,0" P2="49,283" P1="60,253" /><JD c="050505,28,1,0" P2="179,141" P1="185,183" /><JD c="050505,28,1,0" P2="278,200" P1="179,141" /><JD c="050505,28,1,0" P2="180,254" P1="278,200" /><JD c="050505,28,1,0" P2="177,199" P1="180,254" /><JD c="050505,28,1,0" P2="250,204" P1="168,210" /><JD c="050505,28,1,0" P2="200,175" P1="208,232" /><JD c="050505,28,1,0" P2="238,198" P1="200,175" /><JD c="050505,12,1,0" P2="292,204" P1="261,209" /><JD c="050505,12,1,0" P2="170,125" P1="170,170" /><L /></L></Z></C>'
- for k, v in next, {'AutoShaman', 'AutoTimeLeft', 'AfkDeath', 'AutoNewGame'} do
- tfm.exec['disable' .. v]()
- end
- tfm.exec.newGame(xml)
- function eventNewPlayer(name)
- data[name] = {clicks = 0}
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- function eventNewGame()
- tfm.exec.setGameTime(30)
- ui.setMapName('...')
- ui.addTextArea(0, "<font size='700'>•", nil, 250, -272, 486, 634, 0xc64ad4, 0x000000, 0, true)
- gametime = 5
- for k, v in next, data do
- v.clicks = 0
- end
- end
- function eventLoop(elapsed, remaining)
- local elapsed, remaining = math.floor(elapsed/1000), math.floor(remaining/1000)
- gametime = gametime - 0.5
- if (elapsed < 5) then
- if (not tostring(gametime):find('.5')) then
- ui.setMapName('The round will start in ' .. (gametime + 1) .. ' seconds.')
- end
- elseif (elapsed == 5) then
- ui.setMapName('Click!')
- ui.updateTextArea(0, "<a href='event:click'><font size='700'><vp>•</a>", nil)
- elseif (elapsed == 20) then
- local str = ''
- local clicks = {}
- for k, v in next, data do
- clicks[#clicks + 1] = {k, v.clicks}
- end
- table.sort(clicks, function(a, b) return a[2] > b[2] end)
- for i = 1, #clicks do
- str = str .. '<v>' .. clicks[i][1] .. '<n>: <j>' .. clicks[i][2] .. '\n'
- end
- ui.updateTextArea(0, "<font size='700'>•", nil)
- ui.addTextArea(1, str, nil, 50, 50)
- end
- if (remaining <= 0) then
- ui.removeTextArea(1, nil)
- tfm.exec.newGame(xml)
- end
- end
- function eventTextAreaCallback(id, name, link)
- if (link == 'click') then
- data[name].clicks = data[name].clicks + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement