Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Carregando...")
- module={}
- module.time=os.time()
- module.text={
- info="<b>Gravidade:<v>%s</v>\nVento:<v>%s</v>\nMelhor tempo:<j>%s</j>-<v>%s",
- }
- module.addText=function(self,id,txt,p,x,y)
- ui.addTextArea(id,txt,p,x,y,nil,nil,1,1,0)
- end
- function module:start(m,name,t)
- self.data={}
- self.record={}
- self.name=name
- self.mt=t
- self.m=m
- self.NewPlayer=function(self,p)
- self.data[p]=not self.data[p] and {time=os.time()} or self.data[p]
- tfm.exec.bindKeyboard(p,string.byte('X'),true,true)
- tfm.exec.bindKeyboard(p,string.byte('C'),true,true)
- self.data[p].CP=function(self,x,y)
- if self.time<os.time()-1000 then
- self.x=x
- self.y=y
- tfm.exec.displayParticle(9,x,y,0,0,0,0,p)
- self.time=os.time()
- end
- end
- end
- self.Keyboard=function(self,p,k,d,x,y)
- if string.byte('X')==k then
- self.data[p]:CP(x,y)
- elseif string.byte('C')==k then
- if self.data[p].x then
- tfm.exec.movePlayer(p,self.data[p].x,self.data[p].y)
- end
- end
- end
- self.PlayerDied=function(self,p)
- tfm.exec.respawnPlayer(p)
- end
- self.Chat=function(self,p,c)
- clower=c:lower()
- if clower=="mort" then
- tfm.exec.killPlayer(p)
- end
- end
- self.Loop=function(self,a,b)
- if self.carregado then
- if b<=0 then self:np() end
- w,g=0,10
- for a,b in self.xml.xml:gmatch('G="(.-),(.-)"') do
- w,g=a,b
- end
- if #self.record[self.xml.mapCode]>0 then
- table.sort(self.record[self.xml.mapCode],function(a,b) return a.t<b.t end)
- end
- top_tb=self.record[self.xml.mapCode][1] or {p="",t=""}
- self:addText(0,self.text.info:format(g or 10,w or 0,top_tb.p,top_tb.t),nil,5,20)
- end
- end
- self.NewGame=function(self,xml)
- self.xml=xml
- tfm.exec.setGameTime(self.mt)
- self.record[xml.mapCode]=not self.record[xml.mapCode] and {} or self.record[xml.mapCode]
- end
- self.Won=function(self,player,_,time)
- table.insert(self.record[self.xml.mapCode],{p=player,t=time/100})
- end
- self.np=function(self)
- local pm=self.m
- tfm.exec.newGame(pm[math.random(#pm)])
- end
- self.config=function()
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- end
- self:config()
- self:np()
- _G.eventLoop=function(a,b) self:Loop(a,b) end
- _G.eventNewPlayer=function(p) self:NewPlayer(p) end
- _G.eventNewGame=function() self:NewGame(tfm.get.room.xmlMapInfo) end
- _G.eventPlayerWon=function(p,_,t) self:Won(p,_,t) end
- _G.eventPlayerDied=function(p) self:PlayerDied(p) end
- _G.eventKeyboard=function(p,k,d,x,y) self:Keyboard(p,k,d,x,y) end
- _G.eventChatCommand=function(p,c) self:Chat(p,c) end
- table.foreach(tfm.get.room.playerList,function(k) self:NewPlayer(k) end)
- self.carregado=true
- end
- s_table={
- {113156,124000,149422,149451,150651,150664,151655,152260,152733,153996,155480,155606,155611,155628,155765,156720,157004,157203,157805,157960,158345,158417,158909,159145,159187,159298,159932,160841,161023,161434,162482,163094,163159,163172,163506,163531,163596,164544,164916,165186,166032,166056,166271,166333,166361,166430,166805,167075,167903,168204,168754,169059,169076,169110,169139,169228,170514,171148,171480,171482,171776,172501,172512,172520,172547,172605,172621,172951,172976,173623,173816,174223,175204,175280,176253,176507,176619,176710,176729,177652,179005,179488,179492,179807,180801,182370,182769,183139,183141,184648,184817,184868,185289,185428,185529,185873,185887,186066,189819,190646,190996,191177,191203,191205,191443,191642,192158,192255,192560,192959,193662,195116,195672,197229,199210,199710,201000,202574,203664,204488,204647,205240,205506,206396,208056,208373,208653,208940,209848,213752,213755,213874,214631,214755,216171,216173,217261,220352,222377,222910,223947,225744,226266,227093,230588,231137,231921,232469,232675,232678,235037,236768,237091,242291,250153,254785,257218,257324,257715,258192,258908,259319,261298,261814,263819,263926,264091,268915,270143,270924,271193,271411,272402,272518,272689,277427,277513,277824,279337,281948,282584,286254,289865,293559,295465,295630,295932,297442,299942,299983,301610,302080,303151,303939,304861,305567,305614,305820,306365,306384,307324,313216,314743,315666,315800,316012,318129,319443,320483,320626,322582,327354,327743,329200,329318,329571,330933,330967,331344,331988,332130,332906,333002,336305,337644,342035,343456,354984,361500,365061,368839,372255,372419,373105,374995,375455,376704,378704,380516,391924,392240,394132,395216,395310,395961,397467,397469,397478,399364,401630,403755,403940,408577,408643,410040,410045,412467,412913,419335,419369,419635,420877,422981,423311,424604,424685,424900,425884,431433,431749,432501,435812,438333,438364,438449,439092,444589,447805,449496,454049,455271,457726,458528,460961,467137,476706,478236,492222,492399,496610,496886,497965,499986,500000,500690,500748,500894,504485,505619,506032,506613,506940,510996,511136,512887,514311,522719,523270,528032,531084,536905,541223,541693,541729,543010,549666,551317,552986,556575,556841,557066,557074,560526,560583,562897,563436,564198,568122,571683,574183,575497,584783,586901,587501,592189,593164,593431,593530,596239,605255,608368,612415,618999,654894,684566,692650,692740,721319,722837,729863,758595,783547,801683,815336,834297,842019,842167,868262,881158,886744,898934,919484,970919,976944,999963,1000006,1004622,1014313,1018394,1046877,1066607,1111252,1130256,1156092,1157281,1162831,1164086,1225867,1226207,1242584,1255359,1256085,1265789,1266330,1301649,1303323,1323048,1333846,1383297,1384078,1390405,1398609,1403454,1410539,1427980,1435902,1494499,1503203,1526894,1531604,1540221,1580356,1580835,1593066,1595965,1615753,1615949,1620703,1646448,1647131,1657819,1678634,1722755,1733211,1788490,1807217,1809410,1955745,1989803,1990413,2024960,2040569,2130169,2178800,2242899,2311703,2329940,2416969,2423300,2451444,2469365,2520540,2574744,2636519,2788517,2794566,2795201,2846829,2914456,2932238,2989803,3038589,3133917,3136410,3199998,3242049,3295967,3326197,3333223,3380788,3456260,3551333,3668866,3668888,3690269,3734991,3908151,3988424,4000000,4067327,4114521,4445580,5404791},
- "#Bootcamp",
- 180,--Tempo
- }
- module:start(table.unpack(s_table))
- print(("\n<v>%s\n%s"):format(module.name,tostring(os.time()-module.time)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement