mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-14 16:14:53 +09:00
0.15 Ready
This commit is contained in:
1 parent
55ac27054c
commit
2b4de7cf1c
43 files changed
+21
-162
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
entityRemoved={}entityCache={}guis={frames={},buttons={}}defaults={itemRotated={},ranks={{name='Owner',shortHand='Owner',tag='[Owner]',power=0,colour={r=170,g=0,b=0}},{name='Community Manager',shortHand='CM',tag='[Com Mngr]',power=1,colour={r=150,g=68,b=161}},{name='Developer',shortHand='Dev',tag='[Dev]',power=1,colour={r=179,g=125,b=46}},{name='Admin',shortHand='Admin',tag='[Admin]',power=2,colour={r=170,g=41,b=170}},{name='Mod',shortHand='Mod',tag='[Mod]',power=3,colour={r=233,g=63,b=233}},{name='Donator',shortHand='P2W',tag='[P2W]',power=4,colour={r=233,g=63,b=233}},{name='Member',shortHand='Mem',tag='[Member]',power=5,colour={r=24,g=172,b=188}},{name='Regular',shortHand='Reg',tag='[Regukar]',power=5,colour={r=24,g=172,b=188}},{name='Guest',shortHand='',tag='[Guest]',power=6,colour={r=255,g=159,b=27}},{name='Jail',shortHand='Jail',tag='[Jail]',power=7,colour={r=50,g=50,b=50}}},autoRanks={Owner={'badgamernl'},['Community Manager']={'arty714'},Developer={'Cooldude2606'},Admin={'eissturm','PropangasEddy'},Mod={'Alanore','Aquaday','cafeslacker','CrashKonijn','Drahc_pro','Flip','freek18','Hobbitkicker','hud','Matthias','MeDDish','Mindxt20','MottledPetrel','Mr_Happy_212','Phoenix27833','Sand3r205','ScarbVis','Smou','steentje77','TopHatGaming123'},Donator={},Member={},Regular={},Guest={},Jail={}},selected={},jail={}}warningAllowed=nil;timeForRegular=180;CHUNK_SIZE=32;function loadVar(a)if a==nil then local b=nil;if game.players[1].gui.left.hidden then b=game.players[1].gui.left.hidden.caption else b=game.players[1].gui.left.add{type='frame',name='hidden',caption=table.tostring(defaults)}.caption;game.players[1].gui.left.hidden.style.visible=false end;gTable=loadstring('return '..b)()else gTable=a end;itemRotated=gTable.itemRotated;ranks=gTable.ranks;autoRanks=gTable.autoRanks;selected=gTable.selected;jail=gTable.jail end;loadVar(defaults)function saveVar()gTable.itemRotated=itemRotated;gTable.ranks=ranks;gTable.autoRanks=autoRanks;gTable.selected=selected;gTable.jail=jail;game.players[1].gui.left.hidden.caption=table.tostring(gTable)end;local function c(d,e)if d.find_entities_filtered{area=e,type="decorative"}then for f,g in pairs(d.find_entities_filtered{area=e,type="decorative"})do if g.name~="red-bottleneck"and g.name~="yellow-bottleneck"and g.name~="green-bottleneck"then g.destroy()end end end end;local function h(d,i,j,k,l)c(d,{{i,j},{i+k,j+l}})end;local function m()local d=game.surfaces["nauvis"]for n in d.get_chunks()do h(d,n.x*CHUNK_SIZE,n.y*CHUNK_SIZE,CHUNK_SIZE-1,CHUNK_SIZE-1)end;callRank("Decoratives have been removed")end;script.on_event(defines.events.on_chunk_generated,function(o)c(o.surface,o.area)end)function getRank(q)if q then for f,rank in pairs(ranks)do if q.tag==rank.tag then return rank end end;return stringToRank('Guest')end end;function stringToRank(string)if type(string)=='string'then local r={}for f,rank in pairs(ranks)do if rank.name:lower()==string:lower()then return rank end;if rank.name:lower():find(string:lower())then table.insert(r,rank)end end;if#r==1 then return r[1]end end end;function callRank(s,rank,t)local rank=stringToRank(rank)or stringToRank('Mod')local t=t or false;for f,q in pairs(game.players)do rankPower=getRank(q).power;if t then if rankPower>=rank.power then q.print('[Everyone]: '..s)end else if rankPower<=rank.power then if rank.shortHand~=''then q.print('['..rank.shortHand..']: '..s)else q.print('[Everyone]: '..s)end end end end end;function giveRank(q,rank,u,v)local u=u or'system'local rank=stringToRank(rank)or rank;local w=getRank(q)local x='demoted'if rank.power<=w.power then x='promoted'end;if u.name then callRank(q.name..' was '..x..' to '..rank.name..' by '..u.name,w.name)else callRank(q.name..' was '..x..' to '..rank.name..' by <system>',w.name)end;q.tag=rank.tag;drawToolbar(q)drawPlayerList()if v then else game.print(jail[q.index][1])game.print(rank.name)game.print(jail[q.index][1]and rank.name~='Jail')if rank.name=='Jail'and not jail[q.index][1]then jailPlayer(q,u)elseif jail[q.index][1]and rank.name~='Jail'then game.print('Unjail')jail[q.index][1]=false;q.character.active=true end end end;function autoRank(q)local y=getRank(q)local z=nil;for rank,A in pairs(autoRanks)do local B=false;for f,p in pairs(A)do if q.name==p then z=stringToRank(rank)B=true;break end end;if B then break end end;if z then if y.power>z.power then q.tag=z.tag end elseif ticktominutes(q.online_time)>=timeForRegular then q.tag=stringToRank('Regular').tag end;if getRank(q).power<=3 and not q.admin then callRank(q.name..' needs to be promoted.')end;if jail[q.index]==nil then jail[q.index]={false,getRank(q).name}end;if jail[q.index][1]then q.tag=stringToRank('Jail').tag;if q.character then q.character.active=false end end;saveVar()end;function jailPlayer(q,C)if q.character then if q.character.active then jail[q.index][1]=true;jail[q.index][2]=getRank(q).name;giveRank(q,'Jail',C,true)q.character.active=false else jail[q.index][1]=false;local rank=jail[q.index][2]or'Guest'giveRank(q,ranLine truncated
|
||||
entityRemoved={}entityCache={}guis={frames={},buttons={}}defaults={itemRotated={},ranks={{name='Owner',shortHand='Owner',tag='[Owner]',power=0,colour={r=170,g=0,b=0}},{name='Community Manager',shortHand='CM',tag='[Com Mngr]',power=1,colour={r=150,g=68,b=161}},{name='Developer',shortHand='Dev',tag='[Dev]',power=1,colour={r=179,g=125,b=46}},{name='Admin',shortHand='Admin',tag='[Admin]',power=2,colour={r=170,g=41,b=170}},{name='Mod',shortHand='Mod',tag='[Mod]',power=3,colour={r=233,g=63,b=233}},{name='Donator',shortHand='P2W',tag='[P2W]',power=4,colour={r=233,g=63,b=233}},{name='Member',shortHand='Mem',tag='[Member]',power=5,colour={r=24,g=172,b=188}},{name='Regular',shortHand='Reg',tag='[Regukar]',power=5,colour={r=24,g=172,b=188}},{name='Guest',shortHand='',tag='[Guest]',power=6,colour={r=255,g=159,b=27}},{name='Jail',shortHand='Jail',tag='[Jail]',power=7,colour={r=50,g=50,b=50}}},autoRanks={Owner={'badgamernl'},['Community Manager']={'arty714'},Developer={'Cooldude2606'},Admin={'eissturm','PropangasEddy'},Mod={'Alanore','Aquaday','cafeslacker','CrashKonijn','Drahc_pro','Flip','freek18','Hobbitkicker','hud','Matthias','MeDDish','Mindxt20','MottledPetrel','Mr_Happy_212','Phoenix27833','Sand3r205','ScarbVis','Smou','steentje77','TopHatGaming123'},Donator={},Member={},Regular={},Guest={},Jail={}},selected={},jail={}}warningAllowed=nil;timeForRegular=180;CHUNK_SIZE=32;function loadVar(a)if a==nil then local b=nil;if game.players[1].gui.left.hidden then b=game.players[1].gui.left.hidden.caption else b=game.players[1].gui.left.add{type='frame',name='hidden',caption=table.tostring(defaults)}.caption;game.players[1].gui.left.hidden.style.visible=false end;gTable=loadstring('return '..b)()else gTable=a end;itemRotated=gTable.itemRotated;ranks=gTable.ranks;autoRanks=gTable.autoRanks;selected=gTable.selected;jail=gTable.jail end;loadVar(defaults)function saveVar()gTable.itemRotated=itemRotated;gTable.ranks=ranks;gTable.autoRanks=autoRanks;gTable.selected=selected;gTable.jail=jail;game.players[1].gui.left.hidden.caption=table.tostring(gTable)end;function getRank(c)if c then for d,rank in pairs(ranks)do if c.permission_group==game.permissions.get_group(rank.name)then return rank end end;return stringToRank('Guest')end end;function stringToRank(string)if type(string)=='string'then local e={}for d,rank in pairs(ranks)do if rank.name:lower()==string:lower()then return rank end;if rank.name:lower():find(string:lower())then table.insert(e,rank)end end;if#e==1 then return e[1]end end end;function callRank(f,rank,g)local rank=stringToRank(rank)or stringToRank('Mod')local g=g or false;for d,c in pairs(game.players)do rankPower=getRank(c).power;if g then if rankPower>=rank.power then c.print('[Everyone]: '..f)end else if rankPower<=rank.power then if rank.shortHand~=''then c.print('['..rank.shortHand..']: '..f)else c.print('[Everyone]: '..f)end end end end end;function giveRank(c,rank,h,i)local h=h or'system'local rank=stringToRank(rank)or rank;local j=getRank(c)local k='demoted'if rank.power<=j.power then k='promoted'end;if h.name then callRank(c.name..' was '..k..' to '..rank.name..' by '..h.name,j.name)else callRank(c.name..' was '..k..' to '..rank.name..' by <system>',j.name)end;c.permission_group=game.permissions.get_group(rank.name)drawToolbar(c)drawPlayerList()if i then else game.print(jail[c.index][1])game.print(rank.name)game.print(jail[c.index][1]and rank.name~='Jail')if rank.name=='Jail'and not jail[c.index][1]then jailPlayer(c,h)elseif jail[c.index][1]and rank.name~='Jail'then game.print('Unjail')jail[c.index][1]=false;c.character.active=true end end end;function autoRank(c)local l=getRank(c)local m=nil;for rank,n in pairs(autoRanks)do local o=false;for d,p in pairs(n)do if c.name==p then m=stringToRank(rank)o=true;break end end;if o then break end end;if m then if l.power>m.power then c.permission_group=game.permissions.get_group(m.name)end elseif ticktominutes(c.online_time)>=timeForRegular then c.permission_group=game.permissions.get_group('Regular')end;if getRank(c).power<=3 and not c.admin then callRank(c.name..' needs to be promoted.')end;if jail[c.index]==nil then jail[c.index]={false,getRank(c).name}end;if jail[c.index][1]then c.permission_group=game.permissions.get_group('Jail')if c.character then c.character.active=false end end;saveVar()end;function jailPlayer(c,q)if c.character then if c.character.active then jail[c.index][1]=true;jail[c.index][2]=getRank(c).name;giveRank(c,'Jail',q,true)c.character.active=false else jail[c.index][1]=false;local rank=jail[c.index][2]or'Guest'giveRank(c,rank,q,true)c.character.active=true end;saveVar()end end;function ticktohour(r)local s=tostring(math.floor(r/(216000*game.speed)))return s end;function ticktominutes(r)local t=math.floor(r/(3600*game.speed))return t end;function clearSelection(c)selected[c.index]={}end;function autoMessage()local u='Regular'local v='Mod'callRank('There are '..#game.connected_players..' players online',v,true)callRank('This map has been on fLine truncated
|
||||
Reference in new issue
Block a user