Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local a={_VERSION="4.9",_NAME="presents",_STATUS="semi-official",_AUTHOR="Bolodefchoco",_LICENSE=[[
- MIT LICENSE
- Copyright (c) 2017 @Transformice + @Bolodefchoco
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR
- A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- ]],_FREEACCESS={["Bolodefchoco#0000"]=3,["Trumpuke#0000"]=3,["Acer#1412"]=3,["Bodykudo#0000"]=2,["Brenower#0000"]=2,["Jordy#0010"]=2,["Laagaadoo#0000"]=2,["Mescouleur#0000"]=2,["Tat#0020"]=2,["Sebafrancuz#0000"]=2,["Tocutoeltuco#0000"]=2,["Artinoe#0000"]=1,["Auroraclears#0000"]=1,["Barberserk#0000"]=1,["Bibsho#0000"]=1,["Billysmille#0000"]=1,["Bishomilad#0000"]=1,["Evil#9510"]=1,["Byontr#0000"]=1,["Caiolopelope#0000"]=1,["Connow#0000"]=1,["Daelea#0000"]=1,["Drescen#0000"]=1,["Ekull#0000"]=1,["Envidiame#0000"]=1,["Exsilium#0010"]=1,["Foxisara#0000"]=1,["Ghjxpain#0000"]=1,["Kaldt#0000"]=1,["Kimsterjay#0000"]=1,["Ryuuzaki#1216"]=1,["Mcqv#0000"]=1,["Mquk#0020"]=1,["Pidoninho#0000"]=1,["Reshman#0020"]=1,["Santalicious#0010"]=1,["Sebaisseba#0000"]=1,["Tempo#5571"]=1,["Unlocker001#0000"]=1,["Virtini#0000"]=1,["Xorcist#0000"]=1,["Jack_sparrow#8381"]=1}}local b,c,d,e,f,g,h,i,j,k,l,m,n,o=string.len,string.find,string.gmatch,string.byte,string.dump,string.reverse,string.upper,string.format,string.rep,string.lower,string.sub,string.gsub,string.match,string.char;local p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R=math.deg,math.fmod,math.random,math.asin,math.max,math.modf,math.floor,math.cosh,math.ldexp,math.atan2,math.pow,math.randomseed,math.frexp,math.abs,math.tanh,math.acos,math.log,math.tan,math.min,math.ceil,math.sinh,math.sqrt,math.huge,math.rad,math.sin,math.exp,math.cos,math.atan,math.pi;local S,T,U,V,W,X,Y,Z=table.pack,table.foreachi,table.foreach,table.remove,table.insert,table.unpack,table.concat,table.sort;local _,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,aa=bit32.lrotate,bit32.rrotate,bit32.band,bit32.rshift,bit32.lshift,bit32.bnot,bit32.bxor,bit32.replace,bit32.arshift,bit32.btest,bit32.bor,bit32.extract;system.newGameTimer=0;system.officialMode={"",""}system.playerMessage=""system.getAdmins=function()local ab={}for ac,ad in next,a._FREEACCESS do if ad>2 then ab[ac]=true end end;return ab end;do local ae=tfm.exec.newGame;tfm.exec.newGame=function(af)if os.time()>system.newGameTimer then system.newGameTimer=os.time()+3100;ae(af or"#"..tablerandom({0,0,0,0,1,1,1,4,5,6,7,8,9,1,4,5,6,7,8,9,0}))return true end;return false end;local ag=tfm.exec.addImage;local ah=tfm.exec.removeImage;tfm.exec.addImage=function(...)local ai=ag(...)if ai then system.objects.image[ai]=true end;return ai or-1 end;tfm.exec.removeImage=function(ai)ah(ai)if system.objects.image[ai]then system.objects.image[ai]=nil end end;local aj=function(ak)return m(ak,"([a-zA-Z0-9_%+]+)(#%d+)",function(al,am)return al.."<font size='8'><G>"..am.."</G></font>"end)end;local an=ui.addTextArea;ui.addTextArea=function(ai,ak,...)an(ai,aj(ak),...)if not system.objects.textarea[ai]then system.objects.textarea[ai]=true end end;local ao=tfm.exec.chatMessage;tfm.exec.chatMessage=function(ap,aq)ap=aj(tostring(ap))if#ap>1000 then local ar=0;while#ap>ar do local as=m(l(ap,ar,ar+1000),"<$","<")ao(as,aq)ar=ar+1001 end else ao(ap,aq)end end;local at=system.savePlayerData;system.savePlayerData=function(aq,au)if a._STATUS=="official"then at(aq,au)return true else return false end end end;system.isRoom=e(tfm.get.room.name,2)~=3;system.roomAdmins=system.getAdmins()system.miscAttrib=0;system.roomNumber,system.roomAttributes=(function()if system.isRoom then local av,aw=n(tfm.get.room.name,"%*?#"..a._NAME.."(%d+)(.*)")return tonumber(av)or 0,aw or""else return 0,""end end)()system.roomLanguage=""system.isPlayer=function(aq)return not not(l(aq,1,1)~="*"and tfm.get.room.playerList[aq]and os.time()-(tfm.get.room.playerList[aq].registrationDate or os.time())>=432e6)end;system.players=function(ax)local ay,ar=0,0;if ax then ay={}end;for ac,ad in next,tfm.get.room.playerList do if system.isPlayer(ac)then ar=ar+1;if not(ad.isDead or ad.isVampire)then if ax then ay[#ay+1]=ac else ay=ay+1 end end end end;return ay,ar end;local az={}currentTime,leftTime=0,0;system.loadTable=function(aA)local aB;for aC in d(aA,"[^%.]+")do aC=tonumber(aC)or aC;aB=aB and aB[aC]or _G[aC]end;return aB end;system.getTranslation=function(aD)if aD and#aD>2 then if mode[system.gameMode].info[aD]then aD=mode[system.gameMode].info[aD].langue end end;return mode[system.gameMode].translations[aD or mode[system.gameMode].langue or tfm.get.room.community]or mode[system.gameMode].translations['en']end;system.looping=function(aE,aF)local aA=1000/aF;local as={}local aG=0;local aH=function()aG=aG+1;as[aG]=system.newTimer(aE,1000,true)end;for aI=0,1000-aA,aA do system.newTimer(aH,1000+aI,false)end;return as end;ui.banner=function(aJ,aK,aL,aq,aM)aM=aM or 5;aK=aK or 100;aL=aL or 100;local aN=tfm.exec.addImage(aJ..".png","&0",aK,aL,aq)system.newTimer(function()tfm.exec.removeImage(aN)end,aM*1000,false)end;mathisNegative=function(aO,aP,aQ)if aO<0 then if aP then return aP end else if aQ then return aQ end end;return aO end;mathpercent=function(aO,aR,ad)ad=ad or 100;local aS=aO/aR*ad;return H(aS,ad)end;mathpythag=function(aT,aU,aV,aW,aX)return(aT-aV)^2+(aU-aW)^2<=aX^2 end;mathsetLim=function(aY,aZ,a_)return aY<aZ and aZ or aY>a_ and a_ or aY end;mathrotatePoint=function(aO,aR,b0)b0=b0%360;if b0<0 then b0=b0+360 end;b0=M(b0)local b1,b2=P(b0),N(b0)return aO*b1-aR*b2,aR*b1+aO*b2 end;mathround=function(aO)return v(aO+.5)end;stringsplit=function(aY,b3,aE)local ab={}for ad in d(aY,b3)do ab[#ab+1]=not aE and ad or aE(ad)end;return ab end;stringnick=function(b4,b5)if not b5 and not b4:find("#")then b4=b4 .."#0000"end;return m(k(b4),"%a",h,1)end;stringtrim=function(aA)return m(aA,"^%s*(.-)%s*$","%1")end;tablefind=function(aB,aY,b6,aE)for ac,ad in next,aB do local b7=type(ad)=="table"and b6 and ad[b6]or ad;if(not aE and b7 or aE(b7))==aY then return true,ac end end;return false,0 end;tableturnTable=function(aO)return type(aO)=="table"and aO or{aO}end;tablerandom=function(as)return type(as)=="table"and as[r(#as)]or r()end;tableshuffle=function(as)local b8=#as;for b7=b8,1,-1 do local b9=r(b8)as[b7],as[b9]=as[b9],as[b7]end;return as end;tablemerge=function(ba,bb)for ac,ad in next,bb do if ba[ac]then if type(ad)=="table"then ba[ac]=tableturnTable(ba[ac])tablemerge(ba[ac],ad)else ba[ac]=ba[ac]or ad end else ba[ac]=ad end end end;tablecopy=function(aB)local ab={}for ac,ad in next,aB do ab[ac]=type(ad)=="table"and tablecopy(ad)or ad end;return ab end;tablelist=function(aC,bc,aE,b7,bd)local ab={}bc=bc or""b7,bd=b7 or 1,bd or#aC;local be=1;for ac,ad in next,aC do if type(ac)~="number"or ac>=b7 and ac<=bd then if aE then ab[be]=aE(ac,ad)else ab[be]=tostring(ad)end;be=be+1 end end;return Y(ab,bc)end;deactivateAccents=function(bf)bf=m(bf,"[áàâäãå]",'a')bf=m(bf,"[ÁÀÂÄÃÅ]",'A')bf=m(bf,"[éèêë]",'e')bf=m(bf,"[ÉÈÊË]",'E')bf=m(bf,"[íìîï]",'i')bf=m(bf,"[ÍÌÎÏ]",'I')bf=m(bf,"[óòôöõ]",'o')bf=m(bf,"[ÓÒÔÖÕ]",'O')bf=m(bf,"[úùûü]",'u')bf=m(bf,"[ÚÙÛÜ]",'U')bf=m(bf,"[ç]",'c')bf=m(bf,"[Ç]",'C')bf=m(bf,"[ñ]",'n')bf=m(bf,"[Ñ]",'N')bf=m(bf,"[ýÿ]",'y')bf=m(bf,"[ÝŸ]",'Y')return bf end;normalizeTranslation=function()if not mode[system.gameMode].translations.pt then mode[system.gameMode].translations.pt=mode[system.gameMode].translations.br end;if not mode[system.gameMode].languageIsSet or mode[system.gameMode].langue==""then if mode[system.gameMode].translations[system.roomLanguage]then mode[system.gameMode].langue=system.roomLanguage elseif mode[system.gameMode].translations[tfm.get.room.community]then mode[system.gameMode].langue=tfm.get.room.community else mode[system.gameMode].langue="en"end;mode[system.gameMode].languageIsSet=true end;for ac,ad in next,mode[system.gameMode].translations do if ac~="en"then tablemerge(ad,mode[system.gameMode].translations.en)end end end;normalizeNumber=function(av,bc)bc=bc or" "av=tostring(v(av))av=m(av,"E(%d+)",function(bg)return j("0",tonumber(bg))end)av=m(g(av),"(...)",function(bh)return bh..bc end)return g(av)end;pairsByIndexes=function(aB,aE)local ab={}for b6 in next,aB do ab[#ab+1]=b6 end;Z(ab,aE)local b7=0;return function()b7=b7+1;if ab[b7]==nil then return nil else return ab[b7],aB[ab[b7]]end end end;local bi={}bi.parseParameters=function(bj)bj=n(bj,"<P (.-)/>")or""local ab={}for bk,bl,aY in d(bj,"([%-%w]+)=([\"'])(.-)%2")do ab[bk]=aY end;return ab,bj end;bi.attribFunc=function(bj,bm)local bn,bo=bi.parseParameters(bj)for ac,ad in next,bm do if bn[ad.attribute]then ad.func(bn[ad.attribute])end end;return bo end;bi.addAttrib=function(bj,ab,bp)local bq=n(bj,"<P (.-)/>")or""for ac,ad in next,ab do if not c(bq,ad.tag)then bj=m(bj,"<P (.-)/>",function(br)return i("<P %s=\"%s\" %s/>",ad.tag,ad.value,br)end)end end;if bp then tfm.exec.newGame(bj)else return bj end end;bi.getCoordinates=function(aA)if c(aA,";")then local aO,aR;local bs,aY=n(aA,"(%a);(%-?%d+)")aY=tonumber(aY)if aY then if bs=="x"then aO=aY else aR=aY end end;return aO or 0,aR or 0 else local bt={}for aO,aR in d(aA,"(%-?%d+) ?, ?(%-?%d+)")do bt[#bt+1]={x=aO,y=aR}end;return bt end end;color={hex_to_rgb=function(bu)bu=i("%06x",bu)return tonumber(l(bu,1,2),16),tonumber(l(bu,3,4),16),tonumber(l(bu,5,6),16)end,hsl_to_rgb=function(bv,aA,bw)local bx,by,bz;if aA==0 then bx,by,bz=bw,bw,bw else local bA=bw<.5 and bw*(1+aA)or bw+aA-bw*aA;local bB=2*bw-bA;bx=color.hue_to_rgb(bB,bA,bv+1/3)by=color.hue_to_rgb(bB,bA,bv)bz=color.hue_to_rgb(bB,bA,bv-1/3)end;return bx*0xFF,by*0xFF,bz*0xFF end,hue_to_rgb=function(bB,bA,as)if as<0 then as=as+1 end;if as>1 then as=as-1 end;if as<1/6 then return bB+(bA-bB)*6*as end;if as<1/2 then return bA end;if as<2/3 then return bB+(bA-bB)*(2/3-as)*6 end;return bB end,rgb_to_hex=function(bx,by,bz)return tonumber(i('%02x%02x%02x',bx,by,bz),16)end,rgb_to_hsl=function(bx,by,bz)local bv,bC,a_,aZ=color.rgb_to_hue(bx,by,bz)local bw=(a_+aZ)*0.5;local aA=bC==0 and 0 or bC/(1-C(2*bw-1))return bv,aA,bw end,rgb_to_hue=function(bx,by,bz)bx=bx/0xFF;by=by/0xFF;bz=bz/0xFF;local aZ=H(bx,by,bz)local a_=t(bx,by,bz)local bC=a_-aZ;local bv;if bC==0 then bv=0 elseif a_==bx then bv=(by-bz)/bC%6 elseif a_==by then bv=(bz-bx)/bC+2 elseif a_==bz then bv=(bx-by)/bC+4 end;bv=v(bv*60+.5)return bv,bC,a_,aZ end,AntiqueWhite=0xFAEBD7,Aqua=0xFFFF,Aquamarine=0x7FFFD4,Azure=0xF0FFFF,Beige=0xF5F5DC,Bisque=0xFFE4C4,Black=0x000000,BlanchedAlmond=0xFFEBCD,Blue=0xFF,BlueViolet=0x8A2BE2,Brown=0xA52A2A,BurlyWood=0xDEB887,CadetBlue=0x5F9EA0,Chartreuse=0x7FFF00,Chocolate=0xD2691E,Coral=0xFF7F50,CornflowerBlue=0x6495ED,Cornsilk=0xFFF8DC,Crimson=0xDC143C,Cyan=0xFFFF,DarkBlue=0x8B,DarkCyan=0x8B8B,DarkGoldenrod=0xB8860B,DarkGray=0xA9A9A9,DarkGreen=0x6400,DarkKhaki=0xBDB76B,DarkMagenta=0x8B008B,DarkOliveGreen=0x556B2F,DarkOrange=0xFF8C00,DarkOrchid=0x9932CC,DarkRed=0x8B0000,DarkSalmon=0xE9967A,DarkSeaGreen=0x8FBC8F,DarkSlateBlue=0x483D8B,DarkSlateGray=0x2F4F4F,DarkTurquoise=0xCED1,DarkViolet=0x9400D3,DeepPink=0xFF1493,DeepSkyBlue=0xBFFF,DimGray=0x696969,DodgerBlue=0x1E90FF,Firebrick=0xB22222,FloralWhite=0xFFFAF0,ForestGreen=0x228B22,Fuchsia=0xFF00FF,Gainsboro=0xDCDCDC,GhostWhite=0xF8F8FF,Gold=0xFFD700,Goldenrod=0xDAA520,Gray=0x808080,Green=0x8000,GreenYellow=0xADFF2F,Honeydew=0xF0FFF0,HotPink=0xFF69B4,IndianRed=0xCD5C5C,Indigo=0x4B0082,Ivory=0xFFFFF0,Khaki=0xF0E68C,Lavender=0xE6E6FA,LavenderBlush=0xFFF0F5,LawnGreen=0x7CFC00,LemonChiffon=0xFFFACD,LightBlue=0xADD8E6,LightCoral=0xF08080,LightCyan=0xE0FFFF,LightGoldenrodYellow=0xFAFAD2,LightGray=0xD3D3D3,LightGreen=0x90EE90,LightPink=0xFFB6C1,LightSalmon=0xFFA07A,LightSeaGreen=0x20B2AA,LightSkyBlue=0x87CEFA,LightSlateGray=0x778899,LightSteelBlue=0xB0C4DE,LightYellow=0xFFFFE0,Lime=0xFF00,LimeGreen=0x32CD32,Linen=0xFAF0E6,Magenta=0xFF00FF,Maroon=0x800000,MediumAquamarine=0x66CDAA,MediumBlue=0xCD,MediumOrchid=0xBA55D3,MediumPurple=0x9370DB,MediumSeaGreen=0x3CB371,MediumSlateBlue=0x7B68EE,MediumSpringGreen=0xFA9A,MediumTurquoise=0x48D1CC,MediumVioletRed=0xC71585,MidnightBlue=0x191970,MintCream=0xF5FFFA,MistyRose=0xFFE4E1,Moccasin=0xFFE4B5,NavajoWhite=0xFFDEAD,Navy=0x80,OldLace=0xFDF5E6,Olive=0x808000,OliveDrab=0x6B8E23,Orange=0xFFA500,OrangeRed=0xFF4500,Orchid=0xDA70D6,PaleGoldenrod=0xEEE8AA,PaleGreen=0x98FB98,PaleTurquoise=0xAFEEEE,PaleVioletRed=0xDB7093,PapayaWhip=0xFFEFD5,PeachPuff=0xFFDAB9,Peru=0xCD853F,Pink=0xFFC0CB,Plum=0xDDA0DD,PowderBlue=0xB0E0E6,Purple=0x800080,Red=0xFF0000,RosyBrown=0xBC8F8F,RoyalBlue=0x4169E1,SaddleBrown=0x8B4513,Salmon=0xFA8072,SandyBrown=0xF4A460,SeaGreen=0x2E8B57,SeaShell=0xFFF5EE,Sienna=0xA0522D,Silver=0xC0C0C0,SkyBlue=0x87CEEB,SlateBlue=0x6A5ACD,SlateGray=0x708090,Snow=0xFFFAFA,SpringGreen=0xFF7F,SteelBlue=0x4682B4,Tan=0xD2B48C,Teal=0x8080,Thistle=0xD8BFD8,Tomato=0xFF6347,Turquoise=0x40E0D0,Violet=0xEE82EE,Wheat=0xF5DEB3,White=0xFFFFFF,WhiteSmoke=0xF5F5F5,Yellow=0xFFFF00,YellowGreen=0x9ACD32}system.gameMode=a._NAME;system.modeChanged=os.time()+1000;system.getGameMode=function(bD,bE)local bF=not not mode[bD]if bF then system.gameMode=bD;if bE then eventOnModeChange()end;system.modeChanged=os.time()+1000 end;return bF end;mode={}mode.presents={translations={en={welcome="<J>Welcome to <VP><B>#presents</B><J>! Choose a gap according to the gift represented and good luck! You will win if your three-gifts-sequence is correct!\nType !p PlayerName to open the profile of the specified player\n\n<CE>Developed by Bolodefchoco and projected by Ruamorangos",choose="You have <PT>%s seconds</PT> to choose a gift!",kill="Those who are out of the correct gift will die!",newGame="New game in <PT>%s seconds!",nowinner="No one won!",appear="You will appear in the next game!",rival="Rivals",won="won!",profile="Rounds <BL>: <V>%s\n<J>Gifts <BL>: <V>%s\n\n<J>Victories <BL>: <V>%s"},br={welcome="<J>Bem-vindo ao <VP><B>#presents</B><J>! Escolha um buraco de acordo com o presente representado e boa sorte! Você ganhará se sua sequência nos três presentes estiver correta!\nDigite !p Jogador para abrir o perfil do jogador especificado\n\n<CE>Desenvolvido por Bolodefchoco, pedido por Ruamorangos",choose="Você tem <PT>%s segundos</PT> para escolher um presente!",kill="Aqueles que estão fora do presente correto morrerão!",newGame="Novo jogo em <PT>%s segundos!",nowinner="Ninguém ganhou!",appear="Você irá aparecer no próximo jogo!",rival="Rivais",won="venceu!",profile="Partidas <BL>: <V>%s\n<J>Presentes <BL>: <V>%s\n\n<J>Vitórias <BL>: <V>%s"}},langue="",info={},isRunning=false,gifts={},chooseTimer=15,blockTimer=0,newMapTimer=0,currentGift=1,generateMap=function()mode.presents.gifts={[1]=tablerandom({2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101}),[2]=tablerandom({2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104}),[3]=tablerandom({2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102})}tfm.exec.newGame('<C><P DS="m;250,120,400,120,550,120" D="x_transformice/x_inventaire/'..mode.presents.gifts[1]..'.jpg,230,60;x_transformice/x_inventaire/'..mode.presents.gifts[2]..'.jpg,380,60;x_transformice/x_inventaire/'..mode.presents.gifts[3]..'.jpg,530,60;x_transformice/x_inventaire/2100.jpg,140,320;x_transformice/x_inventaire/2101.jpg,260,320;x_transformice/x_inventaire/2102.jpg,380,320;x_transformice/x_inventaire/2103.jpg,500,320;x_transformice/x_inventaire/2104.jpg,620,320" /><Z><S><S P="1,0.0001,20,0.2,90,1,0,0" H="700" L="15" X="400" c="3" Y="161" T="4" /><S X="100" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="220" c="3" Y="335" T="4" /><S X="340" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="460" c="3" Y="335" T="4" /><S X="580" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="40" P="0,0,0.3,0.2,0,0,0,0" L="40" X="100" c="3" Y="160" T="0" /><S X="700" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="550" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="400" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="250" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S H="20" P="0,0,0.3,0.2,0,0,0,0" L="800" X="400" Y="10" T="0" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="700" c="3" Y="335" T="4" /><S X="400" P="0,0,0.3,0.2,0,0,0,0" L="800" H="100" c="3" Y="415" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" H="10" L="50" o="324650" X="745" c="3" Y="138" T="13" /><S X="55" P="0,0,0.3,0.2,0,0,0,0" L="50" o="324650" H="10" c="3" Y="138" T="13" /><S P="0,0,0.3,0.2,0,0,0,0" H="140" L="100" o="324650" X="55" c="3" Y="72" T="12" /><S X="745" P="0,0,0.3,0.2,0,0,0,0" L="100" o="324650" H="140" c="3" Y="72" T="12" /><S P="0,0,0,0,0,0,0,0" H="102" L="581" o="6a7495" X="401" c="4" v="3001" Y="78" T="12" /></S><D /><O /><L><JR M2="10" M1="0" /></L></Z></C>')end,killOutOfRange=function()local bG=mode.presents.gifts[mode.presents.currentGift]-2099;for ac,ad in next,tfm.get.room.playerList do if not ad.isDead then if ad.x>=bG*120 and ad.x<=bG*120+80 and ad.y>267 then mode.presents.info[ac].gifts=mode.presents.info[ac].gifts+1;tfm.exec.setPlayerScore(ac,1,true)else tfm.exec.killPlayer(ac)end end end end,victory=function(bH)bH=bH or system.players()<1;if bH then tfm.exec.chatMessage("<J>"..system.getTranslation().nowinner)mode.presents.chooseTimer=0;mode.presents.blockTimer=0 else tfm.exec.chatMessage("<S>"..tablelist(system.players(true),"<J>, <S>",function(ac,ad)mode.presents.info[ad].victories=mode.presents.info[ad].victories+1;return ad end).." <J>"..system.getTranslation().won)end;mode.presents.newMapTimer=10.5 end,reset=function()mode.presents.info={}end,init=function()for bl,aE in next,{"AutoShaman","AutoNewGame","AutoScore","AfkDeath","MortCommand","DebugCommand","PhysicalConsumables"}do tfm.exec["disable"..aE]()end;tfm.exec.setRoomMaxPlayers(30)system.newTimer(function()mode.presents.generateMap()end,1000,false)system.roomAdmins["Ruamorangos#0000"]=true end,eventNewPlayer=function(aq)if not mode.presents.info[aq]then mode.presents.info[aq]={rounds=0,gifts=0,victories=0}end;tfm.exec.chatMessage(system.getTranslation().welcome,aq)if mode.presents.isRunning then ui.addTextArea(0,"<p align='center'><font size='20'><VP>"..system.getTranslation().appear,aq,216,65,365,35,1,1,1,true)else tfm.exec.respawnPlayer(aq)end;ui.banner("15d75ac29b7",200,150,aq)end,eventNewGame=function()mode.presents.isRunning=true;for b7,aO in next,{250,400,550}do tfm.exec.addPhysicObject(b7,aO,75,{type=12,height=90,width=90,miceCollision=false,groundCollision=false,color=0x6A7495})end;for b7=0,1 do ui.removeTextArea(b7)end;mode.presents.chooseTimer=15;mode.presents.blockTimer=0;mode.presents.newMapTimer=0;mode.presents.currentGift=1;for ac,ad in next,mode.presents.info do ad.rounds=ad.rounds+1 end end,eventLoop=function()local bI="<N>"..system.getTranslation().rival.." : <V>"..mathisNegative(system.players()-1,0)if _G.currentTime>4 and mode.presents.isRunning then if mode.presents.chooseTimer>0 then mode.presents.chooseTimer=mode.presents.chooseTimer-.5;if mode.presents.chooseTimer<=0 then mode.presents.blockTimer=5;tfm.exec.addPhysicObject(4,400,270,{type=4,height=10,width=640,miceCollision=true,groundCollision=false})tfm.exec.removePhysicObject(mode.presents.currentGift)else bI=bI.." <G>| <J>"..i(system.getTranslation().choose,v(mode.presents.chooseTimer).."<J>")end;if system.players()==0 then mode.presents.victory(true)end end;if mode.presents.blockTimer>0 then mode.presents.blockTimer=mode.presents.blockTimer-.5;if mode.presents.blockTimer==2 then mode.presents.killOutOfRange()end;if mode.presents.blockTimer<=0 then mode.presents.currentGift=mode.presents.currentGift+1;if mode.presents.currentGift>3 then mode.presents.victory()else tfm.exec.removePhysicObject(4)mode.presents.chooseTimer=15 end else bI=bI.." <G>| <R>"..system.getTranslation().kill end end;if mode.presents.newMapTimer>0 then mode.presents.newMapTimer=mode.presents.newMapTimer-.5;bI="<PS>"..i(system.getTranslation().newGame,v(mode.presents.newMapTimer).."<PS>")if mode.presents.newMapTimer<=0 then mode.presents.generateMap()end end end;ui.setMapName(bI.."<")end,eventChatCommand=function(aq,bh)local bB=stringsplit(bh,"[^%s]+",k)if bB[1]=="p"then bB[2]=bB[2]and stringnick(bB[2])or aq;if mode.presents.info[bB[2]]then ui.addTextArea(1,"<p align='center'><font size='18'><a:active><a href='event:close'>"..bB[2].."</a><p align='left'><font size='13'>\n<J>"..i(system.getTranslation().profile,mode.presents.info[bB[2]].rounds,mode.presents.info[bB[2]].gifts,mode.presents.info[bB[2]].victories),aq,5,30,790,100,1,1,.8,true)end end end,eventTextAreaCallback=function(b7,aq,bh)if bh=="close"then ui.removeTextArea(1,aq)end end}system.objects={image={},textarea={}}eventOnModeChange=function()for ac in next,system.objects.image do tfm.exec.removeImage(ac)end;for ac in next,system.objects.textarea do ui.removeTextArea(ac,nil)end;system.objects={image={},textarea={}}ui.addPopup(0,0,"",nil,-1500,-1500)for ac in next,tfm.get.room.playerList do for b7=0,255 do for ad=0,1 do system.bindKeyboard(ac,b7,ad==0,false)end end;system.bindMouse(ac,false)tfm.exec.setNameColor(ac,-1)tfm.exec.setPlayerScore(ac,0)end;system.roomAdmins=system.getAdmins()tfm.exec.snow(0)for ac,ad in next,{"AutoScore","WatchCommand","AutoNewGame","AutoShaman","AllShamanSkills","MortCommand","DebugCommand","MinimalistMode","AfkDeath","PhysicalConsumables","AutoTimeLeft"}do tfm.exec["disable"..ad](false)end;tfm.exec.setAutoMapFlipMode()tfm.exec.setRoomMaxPlayers(25)tfm.exec.setRoomPassword("")end;az.eventLoop=function(currentTime,leftTime)_G.currentTime=mathround(currentTime/1e3)_G.leftTime=mathround(leftTime/1e3)end;az.eventNewPlayer=function(aq)tfm.exec.lowerSyncDelay(aq)if system.officialMode[2]~=""then tfm.exec.chatMessage(system.officialMode[2],aq)end end;az.eventChatCommand=function(aq,bh)if system.isPlayer(aq)then local bB=stringsplit(bh,"[^%s]+",k)if a._FREEACCESS[aq]then if bB[1]=="refresh"and(a._FREEACCESS[aq]>1 or not system.isRoom)then tfm.exec.chatMessage("[#bolo] Refreshing the module...")eventOnModeChange()system.init(true)return end;if bB[1]=="room"and(a._FREEACCESS[aq]>1 or not system.isRoom)then local bJ=tonumber(bB[2])or 0;if _G["eventChatCommand"]and system.roomNumber~=bJ then system.roomNumber=bJ;tfm.exec.chatMessage("[#bolo] Room number changed.")eventChatCommand(aq,"refresh")end;return end;if bB[1]=="setmisc"and bB[2]and(a._FREEACCESS[aq]>1 or not system.isRoom)then system.miscAttrib=tonumber(bB[2])or 0;system.miscAttrib=mathsetLim(system.miscAttrib,0,99)tfm.exec.chatMessage("[#bolo] Misc attribute changed.")if bB[3]=="true"then eventChatCommand(aq,"refresh")end;return end;if bB[1]=="load"and(a._FREEACCESS[aq]>2 or not system.isRoom)then if os.time()>system.modeChanged and os.time()>system.newGameTimer then if system.getGameMode(bB[2],true)then tfm.exec.chatMessage("[#bolo] Loading "..bB[2])system.init(system.isRoom)end end;return end end;if bB[1]=="module"then bB[2]=h(bB[2]or"")if a["_"..bB[2]]then if bB[2]=="FREEACCESS"then if bB[3]then local bK=tonumber(bB[3])if bK then bK=mathsetLim(bK,1,3)local bL=bK;tfm.exec.chatMessage("[#bolo] "..bB[2].." ["..bK.."] : "..tablelist(a._FREEACCESS,"",function(al,aY)return aY==bK and al.." ~ "or""end),aq)else bB[3]=stringnick(bB[3])tfm.exec.chatMessage("[#bolo] "..bB[3].." ~> "..(a._FREEACCESS[bB[3]]or 0),aq)end end else tfm.exec.chatMessage("[#bolo] "..bB[2].." : "..tablelist(tableturnTable(a["_"..bB[2]]),"\n",function(ac,ad)return ad end),aq)end else tfm.exec.chatMessage(i("VERSION : %s\nNAME : %s\nSTATUS : %s\nAUTHOR : %s\n\nMODE : %s",a._VERSION,a._NAME,a._STATUS,a._AUTHOR,system.gameMode),aq)end;return end;if bB[1]=="modes"then local bM={}for ac,ad in next,mode do if ac~=a._NAME then bM[#bM+1]=ac end end;tfm.exec.chatMessage(tablelist(bM,"\n",function(ac,ad)return i("~> /room #%s%s@%s#%s",a._NAME,r(0,999),aq,ad)end),aq)return end;if bB[1]=="stop"and system.roomAdmins[aq]then system.exit()end;if bB[1]=="admin"then tfm.exec.chatMessage("[#bolo] Room Admins : "..tablelist(system.roomAdmins,", ",tostring),aq)return end;if bB[1]=="adm"and bB[2]and(system.roomAdmins[aq]or a._FREEACCESS[aq]and a._FREEACCESS[aq]>2)then if tablefind({"true","false"},bB[3])then local bN=stringnick(bB[2])system.roomAdmins[bN]=not not a._FREEACCESS[bN]or bB[3]=="true"or nil;eventChatCommand(aq,"admin")end;return end;if bB[1]=="setroomlanguage"and bB[2]and(system.roomAdmins[aq]or a._FREEACCESS[aq]and a._FREEACCESS[aq]>2)then if mode[system.gameMode].translations[bB[2]]then system.roomLanguage=bB[2]mode[system.gameMode].langue=system.roomLanguage;tfm.exec.chatMessage("[#bolo] Language set to "..mode[system.gameMode].langue)end;return end;if bB[1]=="data"and bB[2]and(a._FREEACCESS[aq]and a._FREEACCESS[aq]>2)then bB[2]=stringnick(bB[2])system.loadPlayerData(bB[2])end;if bB[1]=="me"then local bO={[0]={"!modes"},[1]={"!refresh (tribe house)","!setMisc [number] [refresh] (tribe house)","!room [number] (tribe house)","!load [mode] (tribe house)"},[2]={"!refresh","!setMisc [number] [refresh]","!room [number]","!load [mode] (tribe house)"},[3]={"!refresh","!setMisc [number] [refresh]","!room [number]","!load [mode]","!data [name]"}}local bP=a._FREEACCESS[aq]or 0;if system.roomAdmins[aq]then for ac,ad in next,{"!stop","!adm [playerName] [true/false]","!setRoomLanguage [language]"}do bO[bP][#bO[bP]+1]=ad end end;tfm.exec.chatMessage(i("@%s\nACCESS : %s\nROOM ADMIN : %s\n\n~> Commands: %s",aq,bP,tostring(not not system.roomAdmins[aq]),Y(bO[bP],"; ")),aq)return end end end;az.eventPlayerDataLoaded=function(aq,bC)tfm.exec.chatMessage(aq.."'s data:\n"..bC,a._AUTHOR)end;system.roomSettings={[1]={char="@",execute=function(aq)if aq and#aq>2 then system.roomAdmins[stringnick(aq)]=true end end},[2]={char="#",execute=function(al)if al then local bQ=system.getGameMode(al)if not bQ then system.gameMode=a._NAME end end end},[3]={char="*",execute=function(ai)system.miscAttrib=tonumber(ai)or 1;system.miscAttrib=mathsetLim(system.miscAttrib,1,99)end},[4]={char="!",execute=function(bR)if bR and#bR>0 then system.roomLanguage=k(bR)end end}}system.setRoom=function()if system.isRoom and system.roomAttributes then for bS in d(system.roomAttributes,system.roomSettings[1].char.."(%+?[a-zA-Z0-9_]+#%d%d%d%d)")do system.roomSettings[1].execute(bS)end;system.roomSettings[2].execute(n(system.roomAttributes,system.roomSettings[2].char.."([%a_]+)"))local bT=tablelist(system.roomSettings,"",function(b6,aY)return aY.char end,3)for bU,aY in d(system.roomAttributes,"(["..bT.."])([^"..bT.."]+)")do for ai,bV in next,system.roomSettings do if bV.char==bU then bV.execute(d(aY,"%S+"))break end end end;local bW={{"vanilla","<VP>Enjoy your vanilla (: .. okno"},{"survivor","<R>Aw, you cannot play survivor on #grounds"},{"racing","<CH>Uh, racing? Good luck!"},{"music","<BV>Music? Nice choice! Why don't you try a rock'n'roll?"},{"bootcamp","<PT>Bootcamp? Ok. This is unfair and your data won't be saved out of the room."},{"defilante","<R>Aw, you cannot play defilante on #grounds"},{"village","<R>You cannot play village on #grounds. Please, change your room."}}for ac,ad in next,bW do if c(k(system.roomAttributes),ad[1])then system.officialMode={ad[1],ad[2]}break end end end end;local bX={}local bY={"eventLoop","eventNewGame","eventPlayerDied","eventPlayerMeep","eventPlayerGetCheese","eventFileLoaded","eventFileSaved","eventPlayerVampire","eventPlayerWon","eventPlayerLeft","eventEmotePlayed","eventKeyboard","eventMouse","eventPopupAnswer","eventTextAreaCallback","eventChatCommand","eventChatMessage","eventPlayerDataLoaded","eventSummoningStart","eventSummoningEnd","eventSummoningCancel","eventNewPlayer","eventPlayerRespawn","eventColorPicked"}local bZ=function()end;system.init=function(b_)bX={}for bl,c0 in next,bY do bX[c0]=mode[system.gameMode][c0]or bZ end;if b_ then if mode[system.gameMode].reset then mode[system.gameMode].reset()end end;normalizeTranslation()mode[system.gameMode].init()U(tfm.get.room.playerList,eventNewPlayer)end;for bl,c0 in next,bY do _G[c0]=function(...)if az[c0]then az[c0](...)end;bX[c0](...)end end;system.disableChatCommandDisplay()system.setRoom()system.init()
Advertisement
Add Comment
Please, Sign In to add comment