diff --git a/control.lua b/control.lua index aa7b0cc6..ade64193 100644 --- a/control.lua +++ b/control.lua @@ -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 ',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,rank,C,true)q.character.active=true end;saveVar()end end;function ticktohour(D)local E=tostring(math.floor(D/(216000*game.speed)))return E end;function ticktominutes(D)local F=math.floor(D/(3600*game.speed))return F end;function clearSelection(q)selected[q.index]={}end;function autoMessage()local G='Regular'local H='Mod'callRank('There are '..#game.connected_players..' players online',H,true)callRank('This map has been on for '..ticktohour(game.tick)..' Hours and '..ticktominutes(game.tick)-60*ticktohour(game.tick)..' Minutes',H,true)callRank('Please join us on:',G,true)callRank('Discord: https://discord.gg/RPCxzgt',G,true)callRank('Forum: explosivegaming.nl',G,true)callRank('Steam: http://steamcommunity.com/groups/tntexplosivegaming',G,true)callRank('To see these links again goto: Readme > Server Info',G,true)end;function table.val_to_str(I)if"string"==type(I)then I=string.gsub(I,"\n","\\n")if string.match(string.gsub(I,"[^'\"]",""),'^"+$')then return"'"..I.."'"end;return'"'..string.gsub(I,'"','\\"')..'"'else return"table"==type(I)and table.tostring(I)or tostring(I)end end;function table.key_to_str(J)if"string"==type(J)and string.match(J,"^[_%player][_%player%d]*$")then return J else return"["..table.val_to_str(J).."]"end end;function table.tostring(K)local L,M={},{}for J,I in ipairs(K)do table.insert(L,table.val_to_str(I))M[J]=true end;for J,I in pairs(K)do if not M[J]then table.insert(L,table.key_to_str(J).."="..table.val_to_str(I))end end;return"{"..table.concat(L,",").."}"end;function addFrame(N,rank,O,P,Q)guis.frames[N]={{require=rank,caption=P,tooltip=Q}}addButton('close',function(q,R)R.parent.parent.parent.destroy()end)addButton('btn_'..N,function(q,R)if q.gui.center[N]then q.gui.center[N].destroy()else drawFrame(q,N,O)end end)end;function addTab(N,S,T,U)guis.frames[N][S]={S,T,U}addButton(S,function(q,R)openTab(q,R.parent.parent.parent.name,R.parent.parent.parent.tab,R.name)end)end;function addButton(V,W)guis.buttons[V]={V,W}end;function drawButton(N,V,P,T)N.add{name=V,type="button",caption=P,tooltip=T}end;function openTab(q,X,Y,S)local Z=q.gui.center[X].tabBarScroll.tabBar;for f,a in pairs(guis.frames[X])do if f~=1 then if a[1]==S then Z[a[1]].style.font_color={r=255,g=255,b=255,player=255}clearElement(Y)a[3](q,Y)else Z[a[1]].style.font_color={r=100,g=100,b=100,player=255}end end end end;function drawFrame(q,X,S)if getRank(q).power<=guis.frames[X][1].require then if q.gui.center[X]then q.gui.center[X].destroy()end;local N=q.gui.center.add{name=X,type='frame',caption=X,direction='vertical'}local _=N.add{type="scroll-pane",name="tabBarScroll",vertical_scroll_policy="never",horizontal_scroll_policy="always"}local Z=_.add{type='flow',direction='horizontal',name='tabBar'}local Y=N.add{type="scroll-pane",name="tab",vertical_scroll_policy="auto",horizontal_scroll_policy="never"}for f,a in pairs(guis.frames[X])do if f~=1 then drawButton(Z,a[1],a[1],a[2])end end;openTab(q,X,Y,S)drawButton(Z,'close','Close','Close this window')Y.style.minimal_height=300;Y.style.maximal_height=300;Y.style.minimal_width=500;Y.style.maximal_width=500;_.style.minimal_height=60;_.style.maximal_height=60;_.style.minimal_width=500;_.style.maximal_width=500 end end;function toggleVisable(N)if N then if N.style.visible==nil then N.style.visible=false else N.style.visible=not N.style.visible end end end;function clearElement(a0)if a0~=nil then for a1,R in pairs(a0.children_names)do a0[R].destroy()end end end;script.on_event(defines.events.on_player_created,function(o)local q=game.players[o.player_index]q.insert{name="iron-plate",count=8}q.insert{name="pistol",count=1}q.insert{name="firearm-magazine",count=10}q.insert{name="burner-mining-drill",count=1}q.insert{name="stone-furnace",count=1}q.force.chart(q.surface,{{q.position.x-200,q.position.y-200},{q.position.x+200,q.position.y+200}})end)script.on_event(defines.events.on_player_respawned,function(o)local q=game.players[o.player_index]drawPlayerList()q.insert{name="pistol",count=1}q.insert{name="firearm-magazine",count=10}end)script.on_event(defines.events.on_player_joined_game,function(o)loadVar()local q=game.players[o.player_index]autoRank(q)q.print({"","Welcome"})if q.gui.left.PlayerList~=nil then q.gui.left.PlayerList.destroy()end;if q.gui.center.README~=nil then q.gui.center.README.destroy()end;if q.gui.top.PlayerList~=nil then q.gui.top.PlayerList.destroy()end;drawPlayerList()drawToolbar(q)local a2=encode(game.players,"players",{"name","admin","online_time","connected","index"})game.write_file("players.json",a2,false,0)if not q.admin and ticktominutes(q.online_time)<1 then drawFrame(q,'Readme','Rules')end end)script.on_event(defines.events.on_player_left_game,function(o)local q=game.players[o.player_index]drawPlayerList()end)script.on_event(defines.events.on_gui_click,function(o)local q=game.players[o.player_index]if o.element.type=='button'then for f,a3 in pairs(guis.buttons)do if a3[1]==o.element.name then if a3[2]then a3[2](q,o.element)else callRank('Invaid Button'..a3[1],'Mod')end;break end end elseif o.element.type=='checkbox'then if o.element.name=='select'then if not selected[o.player_index]then selected[o.player_index]={}end;if o.element.state then table.insert(selected[o.player_index],o.element.parent.name)else for f,a4 in pairs(selected[o.player_index])do if a4==o.element.parent.name then table.remove(selected[o.player_index],f)break end end end end;saveVar()end end)script.on_event(defines.events.on_gui_text_changed,function(o)local q=game.players[o.player_index]if o.element.parent.name=='filterTable'then local N=o.element;local a5={}local a6=false;local a7=false;if N.parent.parent.parent.name=='Admin'and not N.parent.sel_input then a6=true;a5[#a5+1]='online'end;if N.parent.parent.parent.name=='Admin'and N.parent.sel_input then a7=true;a5[#a5+1]='lower'end;if N.parent.parent.filterTable.status_input and not a6 then local a8=N.parent.parent.filterTable.status_input.text;if a8=='yes'or a8=='online'or a8=='true'or a8=='y'then a5[#a5+1]='online'elseif a8~=''then a5[#a5+1]='offline'end end;if N.parent.parent.filterTable.hours_input then local a9=N.parent.parent.filterTable.hours_input.text;if tonumber(a9)and tonumber(a9)>0 then a5[#a5+1]=tonumber(a9)end end;if N.parent.parent.filterTable.name_input then local aa=N.parent.parent.filterTable.name_input.text;if aa then a5[#a5+1]=aa end end;if N.parent.parent.filterTable.sel_input then local ab=N.parent.parent.filterTable.sel_input.text;if ab=='yes'or ab=='online'or ab=='true'or ab=='y'then a5[#a5+1]='selected'end end;if N.parent.parent.playerTable then N.parent.parent.playerTable.destroy()end;drawPlayerTable(q,N.parent.parent,a6,a7,a5)end end)script.on_event(defines.events.on_marked_for_deconstruction,function(o)local ac=game.players[o.player_index]if not ac.admin and ticktominutes(ac.online_time)3 then if playerRank.shortHand~=''then Plist.add{type="label",name=q.name,style="caption_label_style",caption={"",ticktohour(q.online_time)," H - ",q.name,' - '..playerRank.shortHand}}else Plist.add{type="label",name=q.name,style="caption_label_style",caption={"",ticktohour(q.online_time)," H - ",q.name}}end;Plist[q.name].style.font_color=playerRank.colour;q.tag=playerRank.tag end end end end;addButton('goto',function(q,N)local p=game.players[N.parent.name]q.teleport(game.surfaces[p.surface.name].find_non_colliding_position("player",p.position,32,1))end)addButton('bring',function(q,N)local p=game.players[N.parent.name]p.teleport(game.surfaces[q.surface.name].find_non_colliding_position("player",q.position,32,1))end)addButton('jail',function(q,N)jailPlayer(game.players[N.parent.name],q)end)addButton('kill',function(q,N)local p=game.players[N.parent.name]if p.character then p.character.die()end end)function drawPlayerTable(q,N,a6,a7,a5)if N.playerTable then N.playerTable.destroy()end;N.add{name='playerTable',type="table",colspan=5}N.playerTable.style.minimal_width=500;N.playerTable.style.maximal_width=500;N.playerTable.style.horizontal_spacing=10;N.playerTable.add{name="id",type="label",caption="Id "}N.playerTable.add{name="name",type="label",caption="Name "}if a6==false and a7==false then N.playerTable.add{name="status",type="label",caption="Status "}end;N.playerTable.add{name="online_time",type="label",caption="Online Time "}N.playerTable.add{name="rank",type="label",caption="Rank "}if a6 then N.playerTable.add{name="commands",type="label",caption="Commands"}end;if a7 then N.playerTable.add{name="select_label",type="label",caption="Selection"}end;for a1,p in pairs(game.players)do local am=true;for f,an in pairs(a5)do if an=='admin'then if p.admin==false then am=false;break end elseif an=='online'then if p.connected==false then am=false;break end elseif an=='offline'then if p.connected==true then am=false;break end elseif an=='lower'then if getRank(p).power<=getRank(q).power then am=false;break end elseif an=='selected'then local B=nil;for f,a4 in pairs(selected[q.index])do if a4==p.name then B=true;break end end;if not B then am=false;break end elseif type(an)=='number'then if an>ticktominutes(p.online_time)then am=false;break end elseif type(an)=='string'then if p.name:lower():find(an:lower())==nil then am=false;break end end end;if am==true and q.name~=p.name then if N.playerTable[p.name]==nil then N.playerTable.add{name=a1 .."id",type="label",caption=a1}N.playerTable.add{name=p.name..'_name',type="label",caption=p.name}if not a6 and not a7 then if p.connected==true then N.playerTable.add{name=p.name.."Status",type="label",caption="ONLINE"}else N.playerTable.add{name=p.name.."Status",type="label",caption="OFFLINE"}end end;N.playerTable.add{name=p.name.."Online_Time",type="label",caption=ticktohour(p.online_time)..'H '..ticktominutes(p.online_time)-60*ticktohour(p.online_time)..'M'}N.playerTable.add{name=p.name.."Rank",type="label",caption=p.tag}if a6 then N.playerTable.add{name=p.name,type="flow"}drawButton(N.playerTable[p.name],'goto','Tp','Goto to the players location')drawButton(N.playerTable[p.name],'bring','Br','Bring player player to your location')if getRank(p).power>getRank(q).power then drawButton(N.playerTable[p.name],'jail','Ja','Jail/Unjail player')drawButton(N.playerTable[p.name],'kill','Ki','Kill this player')end elseif a7 then N.playerTable.add{name=p.name,type="flow"}local ao=false;for f,a4 in pairs(selected[q.index])do if a4==p.name then ao=true;break end end;N.playerTable[p.name].add{name='select',type="checkbox",state=ao}end end end end end;addFrame('Readme',6,'Rules','Readme','Rules, Server info, How to chat, Playerlist, Adminlist.')addTab('Readme','Rules','The rules of the server',function(q,N)local ap={"Hacking/cheating, exploiting and abusing bugs is not allowed.","Do not disrespect any player in the server (This includes staff).","Do not spam, this includes stuff such as chat spam, item spam, chest spam etc.","Do not laydown concrete with bots without permission.","Do not use active provider chests without permission.","Do not remove/move major parts of the factory without permission.","Do not walk in player random direction for no reason(to save map size).","Do not remove stuff just because you don't like it, tell people first.","Do not make train roundabouts.","Trains are Left Hand Drive (LHD) only.","Do not complain about lag, low fps and low ups or other things like that.","Do not ask for rank.","Use common sense and what an admin says goes."}for a1,aq in pairs(ap)do N.add{name=a1,type="label",caption={"",a1,". ",aq}}end end)addTab('Readme','Server Info','Info about the server',function(q,N)N.add{name=1,type="label",caption={"","Discord voice and chat server:"}}N.add{name=2,type='textfield',text='https://discord.gg/RPCxzgt'}.style.minimal_width=400;N.add{name=3,type="label",caption={"","Our forum:"}}N.add{name=4,type='textfield',text='https://explosivegaming.nl'}.style.minimal_width=400;N.add{name=5,type="label",caption={"","Steam:"}}N.add{name=6,type='textfield',text='http://steamcommunity.com/groups/tntexplosivegaming'}.style.minimal_width=400 end)addTab('Readme','How to chat','Just in case you dont know how to chat',function(q,N)local ar={"Chatting for new players can be difficult because it’s different than other games!","It’s very simple, the button you need to press is the “GRAVE/TILDE key”","it’s located under the “ESC key”. If you would like to change the key go to your","controls tab in options. The key you need to change is “Toggle Lua console”","it’s located in the second column 2nd from bottom."}for a1,as in pairs(ar)do N.add{name=a1,type="label",caption={"",as}}end end)addTab('Readme','Admins','List of all the people who can ban you :P',function(q,N)local at={"This list contains all the people that are admin in this world. Do you want to become","an admin dont ask for it! an admin will see what you've made and the time you put","in the server."}for a1,as in pairs(at)do N.add{name=a1,type="label",caption={"",as}}end;drawPlayerTable(q,N,false,false,{'admin'})end)addTab('Readme','Players','List of all the people who have been on the server',function(q,N)local A={"These are the players who have supported us in the making of this factory. Without","you the player we wouldn't have been as far as we are now."}for a1,as in pairs(A)do N.add{name=a1,type="label",caption={"",as}}end;N.add{name='filterTable',type='table',colspan=3}N.filterTable.add{name='name_label',type='label',caption='Name'}N.filterTable.add{name='status_label',type='label',caption='Online?'}N.filterTable.add{name='hours_label',type='label',caption='Online Time (minutes)'}N.filterTable.add{name='name_input',type='textfield'}N.filterTable.add{name='status_input',type='textfield'}N.filterTable.add{name='hours_input',type='textfield'}drawPlayerTable(q,N,false,false,{})end)addFrame('Admin',2,'Player List','Admin',"All admin fuctions are here")addButton('btn_toolbar_automessage',function()autoMessage()end)addButton('tp_all',function(q,N)for a1,p in pairs(game.connected_players)do local au=game.surfaces[q.surface.name].find_non_colliding_position("player",q.position,32,1)if p~=q then p.teleport(au)end end end)addButton('revive_dead_entitys_range',function(q,N)if tonumber(N.parent.range.text)then local av=tonumber(N.parent.range.text)for aw,g in pairs(game.surfaces[1].find_entities_filtered({area={{q.position.x-av,q.position.y-av},{q.position.x+av,q.position.y+av}},type="entity-ghost"}))do g.revive()end end end)addButton('add_dev_items',function(q,N)q.insert{name="deconstruction-planner",count=1}q.insert{name="blueprint-book",count=1}q.insert{name="blueprint",count=20}end)addButton('sendMessage',function(q,N)local rank=stringToRank(N.parent.message.rank.text)if rank then callRank(N.parent.message.message.text,rank.name)else for f,rank in pairs(ranks)do q.print(rank.name)end end end)addButton('setRanks',function(q,N)rank=stringToRank(N.parent.rank_input.text)if rank then for f,ax in pairs(selected[q.index])do p=game.players[ax]if getRank(q).powergetRank(q).power then giveRank(p,rank,q)else q.print('You can not edit '..p.name.."'s rank there rank is too high (or the rank you have slected is above you)")end end else q.print(N.parent.rank_input.text..' is not a Rank, Ranks are:')for f,rank in pairs(ranks)do if rank.power>getRank(q).power then q.print(rank.name)end end end end)addButton('clearSelection',function(q,N)clearSelection(q)drawPlayerTable(q,N.parent.parent,false,true,{})end)addTab('Admin','Commands','Random useful commands',function(q,N)drawButton(N,'btn_toolbar_automessage','Auto Message','Send the auto message to all online players')drawButton(N,'add_dev_items','Get Blueprints','Get all the blueprints')drawButton(N,'revive_dead_entitys_range','Revive Entitys','Brings all dead machines back to life in player range')N.add{type='textfield',name='range',text='Range'}N.add{type='flow',name='message'}N.message.add{type='textfield',name='message',text='Enter message'}N.message.add{type='textfield',name='rank',text='Enter rank'}drawButton(N,'sendMessage','Send Message','Send a message to all ranks higher than the slected')drawButton(N,'tp_all','TP All Here','Brings all players to you')end)addTab('Admin','Edit Ranks','Edit the ranks of players below you',function(q,N)clearSelection(q)N.add{name='filterTable',type='table',colspan=2}N.filterTable.add{name='name_label',type='label',caption='Name'}N.filterTable.add{name='sel_label',type='label',caption='Selected?'}N.filterTable.add{name='name_input',type='textfield'}N.filterTable.add{name='sel_input',type='textfield'}N.add{type='flow',name='rank',direction='horizontal'}N.rank.add{name='rank_label',type='label',caption='Rank'}N.rank.add{name='rank_input',type='textfield'}drawButton(N.rank,'setRanks','Set Ranks','Sets the rank of all selected players')drawButton(N.rank,'clearSelection','Clear Selection','Clears all currently selected players')drawPlayerTable(q,N,false,true,{'lower'})end)addTab('Admin','Player List','Send player message to all players',function(q,N)N.add{name='filterTable',type='table',colspan=2}N.filterTable.add{name='name_label',type='label',caption='Name'}N.filterTable.add{name='hours_label',type='label',caption='Online Time (minutes)'}N.filterTable.add{name='name_input',type='textfield'}N.filterTable.add{name='hours_input',type='textfield'}drawPlayerTable(q,N,true,false,{'online'})end)addFrame('Admin+',1,'Modifiers','Admin+',"Because we are better")addButton('remove_biters',function(q,N)for aw,g in pairs(game.surfaces[1].find_entities_filtered({force='enemy'}))do g.destroy()end end)addButton('toggle_cheat',function(q,N)q.cheat_mode=not q.cheat_mode end)addButton('revive_dead_entitys',function(q,N)for aw,g in pairs(game.surfaces[1].find_entities_filtered({type="entity-ghost"}))do g.revive()end end)addButton("btn_Modifier_apply",function(q,N)local ay={"manual_mining_speed_modifier","manual_crafting_speed_modifier","character_running_speed_modifier","worker_robots_speed_modifier","worker_robots_storage_bonus","character_build_distance_bonus","character_item_drop_distance_bonus","character_reach_distance_bonus","character_resource_reach_distance_bonus","character_item_pickup_distance_bonus","character_loot_pickup_distance_bonus"}for a1,az in pairs(ay)do local aA=tonumber(N.parent.parent.modifierTable[az.."_input"].text:match("[%d]+[.%d+]"))if aA~=nil then if aA>=0 and aA<50 and aA~=q.force[az]then q.force[az]=aA;q.print(az.." changed to number: "..tostring(aA))elseif aA==q.force[az]then q.print(az.." Did not change")else q.print(az.." needs to be player higher number or it contains an letter")end end end end)addTab('Admin+','Commands','Random useful commands',function(q,N)drawButton(N,'btn_toolbar_automessage','Auto Message','Send the auto message to all online players')drawButton(N,'add_dev_items','Get Blueprints','Get all the blueprints')drawButton(N,'revive_dead_entitys','Revive All Entitys','Brings all dead machines back to life')drawButton(N,'revive_dead_entitys_range','Revive Entitys','Brings all dead machines back to life in player range')N.add{type='textfield',name='range',text='Range'}drawButton(N,'remove_biters','Kill Biters','Removes all biters in map')drawButton(N,'tp_all','TP All Here','Brings all players to you')drawButton(N,'toggle_cheat','Toggle Cheat Mode','Toggle your cheat mode')end)addTab('Admin+','Modifiers','Edit in game modifiers',function(q,N)local ay={"manual_mining_speed_modifier","manual_crafting_speed_modifier","character_running_speed_modifier","worker_robots_speed_modifier","worker_robots_storage_bonus","character_build_distance_bonus","character_item_drop_distance_bonus","character_reach_distance_bonus","character_resource_reach_distance_bonus","character_item_pickup_distance_bonus","character_loot_pickup_distance_bonus"}N.add{type="flow",name="flowNavigation",direction="horizontal"}N.add{name="modifierTable",type="table",colspan=3}N.modifierTable.add{name="name",type="label",caption="name"}N.modifierTable.add{name="input",type="label",caption="input"}N.modifierTable.add{name="current",type="label",caption="current"}for a1,az in pairs(ay)do N.modifierTable.add{name=az,type="label",caption=az}N.modifierTable.add{name=az.."_input",type="textfield",caption="inputTextField"}N.modifierTable.add{name=az.."_current",type="label",caption=tostring(q.force[az])}end;drawButton(N.flowNavigation,"btn_Modifier_apply","Apply","Apply the new values to the game")end) \ No newline at end of file +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 ',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 for '..ticktohour(game.tick)..' Hours and '..ticktominutes(game.tick)-60*ticktohour(game.tick)..' Minutes',v,true)callRank('Please join us on:',u,true)callRank('Discord: https://discord.gg/RPCxzgt',u,true)callRank('Forum: explosivegaming.nl',u,true)callRank('Steam: http://steamcommunity.com/groups/tntexplosivegaming',u,true)callRank('To see these links again goto: Readme > Server Info',u,true)end;function table.val_to_str(w)if"string"==type(w)then w=string.gsub(w,"\n","\\n")if string.match(string.gsub(w,"[^'\"]",""),'^"+$')then return"'"..w.."'"end;return'"'..string.gsub(w,'"','\\"')..'"'else return"table"==type(w)and table.tostring(w)or tostring(w)end end;function table.key_to_str(x)if"string"==type(x)and string.match(x,"^[_%player][_%player%d]*$")then return x else return"["..table.val_to_str(x).."]"end end;function table.tostring(y)local z,A={},{}for x,w in ipairs(y)do table.insert(z,table.val_to_str(w))A[x]=true end;for x,w in pairs(y)do if not A[x]then table.insert(z,table.key_to_str(x).."="..table.val_to_str(w))end end;return"{"..table.concat(z,",").."}"end;function addFrame(B,rank,C,D,E)guis.frames[B]={{require=rank,caption=D,tooltip=E}}addButton('close',function(c,F)F.parent.parent.parent.destroy()end)addButton('btn_'..B,function(c,F)if c.gui.center[B]then c.gui.center[B].destroy()else drawFrame(c,B,C)end end)end;function addTab(B,G,H,I)guis.frames[B][G]={G,H,I}addButton(G,function(c,F)openTab(c,F.parent.parent.parent.name,F.parent.parent.parent.tab,F.name)end)end;function addButton(J,K)guis.buttons[J]={J,K}end;function drawButton(B,J,D,H)B.add{name=J,type="button",caption=D,tooltip=H}end;function openTab(c,L,M,G)local N=c.gui.center[L].tabBarScroll.tabBar;for d,a in pairs(guis.frames[L])do if d~=1 then if a[1]==G then N[a[1]].style.font_color={r=255,g=255,b=255,player=255}M.clear()a[3](c,M)else N[a[1]].style.font_color={r=100,g=100,b=100,player=255}end end end end;function drawFrame(c,L,G)if getRank(c).power<=guis.frames[L][1].require then if c.gui.center[L]then c.gui.center[L].destroy()end;local B=c.gui.center.add{name=L,type='frame',caption=L,direction='vertical'}local O=B.add{type="scroll-pane",name="tabBarScroll",vertical_scroll_policy="never",horizontal_scroll_policy="always"}local N=O.add{type='flow',direction='horizontal',name='tabBar'}local M=B.add{type="scroll-pane",name="tab",vertical_scroll_policy="auto",horizontal_scroll_policy="never"}for d,a in pairs(guis.frames[L])do if d~=1 then drawButton(N,a[1],a[1],a[2])end end;openTab(c,L,M,G)drawButton(N,'close','Close','Close this window')M.style.minimal_height=300;M.style.maximal_height=300;M.style.minimal_width=500;M.style.maximal_width=500;O.style.minimal_height=60;O.style.maximal_height=60;O.style.minimal_width=500;O.style.maximal_width=500 end end;function toggleVisable(B)if B then if B.style.visible==nil then B.style.visible=false else B.style.visible=not B.style.visible end end end;script.on_event(defines.events.on_player_created,function(P)local c=game.players[P.player_index]c.insert{name="iron-plate",count=8}c.insert{name="pistol",count=1}c.insert{name="firearm-magazine",count=10}c.insert{name="burner-mining-drill",count=1}c.insert{name="stone-furnace",count=1}c.force.chart(c.surface,{{c.position.x-200,c.position.y-200},{c.position.x+200,c.position.y+200}})end)script.on_event(defines.events.on_player_respawned,function(P)local c=game.players[P.player_index]drawPlayerList()c.insert{name="pistol",count=1}c.insert{name="firearm-magazine",count=10}end)script.on_event(defines.events.on_player_joined_game,function(P)loadVar()if#game.players==1 then for d,rank in pairs(ranks)do game.permissions.create_group(rank.name)end end;local c=game.players[P.player_index]autoRank(c)c.print({"","Welcome"})if c.gui.left.PlayerList~=nil then c.gui.left.PlayerList.destroy()end;if c.gui.center.README~=nil then c.gui.center.README.destroy()end;if c.gui.top.PlayerList~=nil then c.gui.top.PlayerList.destroy()end;drawPlayerList()drawToolbar(c)local Q=encode(game.players,"players",{"name","admin","online_time","connected","index"})game.write_file("players.json",Q,false,0)if not c.admin and ticktominutes(c.online_time)<1 then drawFrame(c,'Readme','Rules')end end)script.on_event(defines.events.on_player_left_game,function(P)local c=game.players[P.player_index]drawPlayerList()end)script.on_event(defines.events.on_gui_click,function(P)local c=game.players[P.player_index]if P.element.type=='button'then for d,R in pairs(guis.buttons)do if R[1]==P.element.name then if R[2]then R[2](c,P.element)else callRank('Invaid Button'..R[1],'Mod')end;break end end elseif P.element.type=='checkbox'then if P.element.name=='select'then if not selected[P.player_index]then selected[P.player_index]={}end;if P.element.state then table.insert(selected[P.player_index],P.element.parent.name)else for d,S in pairs(selected[P.player_index])do if S==P.element.parent.name then table.remove(selected[P.player_index],d)break end end end end;saveVar()end end)script.on_event(defines.events.on_gui_text_changed,function(P)local c=game.players[P.player_index]if P.element.parent.name=='filterTable'then local B=P.element;local T={}local U=false;local V=false;if B.parent.parent.parent.name=='Admin'and not B.parent.sel_input then U=true;T[#T+1]='online'end;if B.parent.parent.parent.name=='Admin'and B.parent.sel_input then V=true;T[#T+1]='lower'end;if B.parent.parent.filterTable.status_input and not U then local W=B.parent.parent.filterTable.status_input.text;if W=='yes'or W=='online'or W=='true'or W=='y'then T[#T+1]='online'elseif W~=''then T[#T+1]='offline'end end;if B.parent.parent.filterTable.hours_input then local X=B.parent.parent.filterTable.hours_input.text;if tonumber(X)and tonumber(X)>0 then T[#T+1]=tonumber(X)end end;if B.parent.parent.filterTable.name_input then local Y=B.parent.parent.filterTable.name_input.text;if Y then T[#T+1]=Y end end;if B.parent.parent.filterTable.sel_input then local Z=B.parent.parent.filterTable.sel_input.text;if Z=='yes'or Z=='online'or Z=='true'or Z=='y'then T[#T+1]='selected'end end;if B.parent.parent.playerTable then B.parent.parent.playerTable.destroy()end;drawPlayerTable(c,B.parent.parent,U,V,T)end end)script.on_event(defines.events.on_marked_for_deconstruction,function(P)local _=game.players[P.player_index]if not _.admin and ticktominutes(_.online_time)3 then if playerRank.shortHand~=''then Plist.add{type="label",name=c.name,style="caption_label_style",caption={"",ticktohour(c.online_time)," H - ",c.name,' - '..playerRank.shortHand}}else Plist.add{type="label",name=c.name,style="caption_label_style",caption={"",ticktohour(c.online_time)," H - ",c.name}}end;Plist[c.name].style.font_color=playerRank.colour;c.tag=playerRank.tag end end end end;addButton('goto',function(c,B)local p=game.players[B.parent.name]c.teleport(game.surfaces[p.surface.name].find_non_colliding_position("player",p.position,32,1))end)addButton('bring',function(c,B)local p=game.players[B.parent.name]p.teleport(game.surfaces[c.surface.name].find_non_colliding_position("player",c.position,32,1))end)addButton('jail',function(c,B)jailPlayer(game.players[B.parent.name],c)end)addButton('kill',function(c,B)local p=game.players[B.parent.name]if p.character then p.character.die()end end)function drawPlayerTable(c,B,U,V,T)if B.playerTable then B.playerTable.destroy()end;B.add{name='playerTable',type="table",colspan=5}B.playerTable.style.minimal_width=500;B.playerTable.style.maximal_width=500;B.playerTable.style.horizontal_spacing=10;B.playerTable.add{name="id",type="label",caption="Id "}B.playerTable.add{name="Pname",type="label",caption="Name "}if U==false and V==false then B.playerTable.add{name="status",type="label",caption="Status "}end;B.playerTable.add{name="online_time",type="label",caption="Online Time "}B.playerTable.add{name="rank",type="label",caption="Rank "}if U then B.playerTable.add{name="commands",type="label",caption="Commands"}end;if V then B.playerTable.add{name="select_label",type="label",caption="Selection"}end;for a6,p in pairs(game.players)do local aa=true;for d,ab in pairs(T)do if ab=='admin'then if p.admin==false then aa=false;break end elseif ab=='online'then if p.connected==false then aa=false;break end elseif ab=='offline'then if p.connected==true then aa=false;break end elseif ab=='lower'then if getRank(p).power<=getRank(c).power then aa=false;break end elseif ab=='selected'then local o=nil;for d,S in pairs(selected[c.index])do if S==p.name then o=true;break end end;if not o then aa=false;break end elseif type(ab)=='number'then if ab>ticktominutes(p.online_time)then aa=false;break end elseif type(ab)=='string'then if p.name:lower():find(ab:lower())==nil then aa=false;break end end end;if aa==true and c.name~=p.name then if B.playerTable[p.name]==nil then B.playerTable.add{name=a6 .."id",type="label",caption=a6}B.playerTable.add{name=p.name..'_name',type="label",caption=p.name}if not U and not V then if p.connected==true then B.playerTable.add{name=p.name.."Status",type="label",caption="ONLINE"}else B.playerTable.add{name=p.name.."Status",type="label",caption="OFFLINE"}end end;B.playerTable.add{name=p.name.."Online_Time",type="label",caption=ticktohour(p.online_time)..'H '..ticktominutes(p.online_time)-60*ticktohour(p.online_time)..'M'}B.playerTable.add{name=p.name.."Rank",type="label",caption=p.tag}if U then B.playerTable.add{name=p.name,type="flow"}drawButton(B.playerTable[p.name],'goto','Tp','Goto to the players location')drawButton(B.playerTable[p.name],'bring','Br','Bring player player to your location')if getRank(p).power>getRank(c).power then drawButton(B.playerTable[p.name],'jail','Ja','Jail/Unjail player')drawButton(B.playerTable[p.name],'kill','Ki','Kill this player')end elseif V then B.playerTable.add{name=p.name,type="flow"}local ac=false;for d,S in pairs(selected[c.index])do if S==p.name then ac=true;break end end;B.playerTable[p.name].add{name='select',type="checkbox",state=ac}end end end end end;addFrame('Readme',6,'Rules','Readme','Rules, Server info, How to chat, Playerlist, Adminlist.')addTab('Readme','Rules','The rules of the server',function(c,B)local ad={"Hacking/cheating, exploiting and abusing bugs is not allowed.","Do not disrespect any player in the server (This includes staff).","Do not spam, this includes stuff such as chat spam, item spam, chest spam etc.","Do not laydown concrete with bots without permission.","Do not use active provider chests without permission.","Do not remove/move major parts of the factory without permission.","Do not walk in player random direction for no reason(to save map size).","Do not remove stuff just because you don't like it, tell people first.","Do not make train roundabouts.","Trains are Left Hand Drive (LHD) only.","Do not complain about lag, low fps and low ups or other things like that.","Do not ask for rank.","Use common sense and what an admin says goes."}for a6,ae in pairs(ad)do B.add{name=a6,type="label",caption={"",a6,". ",ae}}end end)addTab('Readme','Server Info','Info about the server',function(c,B)B.add{name=1,type="label",caption={"","Discord voice and chat server:"}}B.add{name=2,type='textfield',text='https://discord.gg/RPCxzgt'}.style.minimal_width=400;B.add{name=3,type="label",caption={"","Our forum:"}}B.add{name=4,type='textfield',text='https://explosivegaming.nl'}.style.minimal_width=400;B.add{name=5,type="label",caption={"","Steam:"}}B.add{name=6,type='textfield',text='http://steamcommunity.com/groups/tntexplosivegaming'}.style.minimal_width=400 end)addTab('Readme','How to chat','Just in case you dont know how to chat',function(c,B)local af={"Chatting for new players can be difficult because it’s different than other games!","It’s very simple, the button you need to press is the “GRAVE/TILDE key”","it’s located under the “ESC key”. If you would like to change the key go to your","controls tab in options. The key you need to change is “Toggle Lua console”","it’s located in the second column 2nd from bottom."}for a6,ag in pairs(af)do B.add{name=a6,type="label",caption={"",ag}}end end)addTab('Readme','Admins','List of all the people who can ban you :P',function(c,B)local ah={"This list contains all the people that are admin in this world. Do you want to become","an admin dont ask for it! an admin will see what you've made and the time you put","in the server."}for a6,ag in pairs(ah)do B.add{name=a6,type="label",caption={"",ag}}end;drawPlayerTable(c,B,false,false,{'admin'})end)addTab('Readme','Players','List of all the people who have been on the server',function(c,B)local n={"These are the players who have supported us in the making of this factory. Without","you the player we wouldn't have been as far as we are now."}for a6,ag in pairs(n)do B.add{name=a6,type="label",caption={"",ag}}end;B.add{name='filterTable',type='table',colspan=3}B.filterTable.add{name='name_label',type='label',caption='Name'}B.filterTable.add{name='status_label',type='label',caption='Online?'}B.filterTable.add{name='hours_label',type='label',caption='Online Time (minutes)'}B.filterTable.add{name='name_input',type='textfield'}B.filterTable.add{name='status_input',type='textfield'}B.filterTable.add{name='hours_input',type='textfield'}drawPlayerTable(c,B,false,false,{})end)addFrame('Admin',2,'Player List','Admin',"All admin fuctions are here")addButton('btn_toolbar_automessage',function()autoMessage()end)addButton('tp_all',function(c,B)for a6,p in pairs(game.connected_players)do local ai=game.surfaces[c.surface.name].find_non_colliding_position("player",c.position,32,1)if p~=c then p.teleport(ai)end end end)addButton('revive_dead_entitys_range',function(c,B)if tonumber(B.parent.range.text)then local aj=tonumber(B.parent.range.text)for ak,al in pairs(game.surfaces[1].find_entities_filtered({area={{c.position.x-aj,c.position.y-aj},{c.position.x+aj,c.position.y+aj}},type="entity-ghost"}))do al.revive()end end end)addButton('add_dev_items',function(c,B)c.insert{name="deconstruction-planner",count=1}c.insert{name="blueprint-book",count=1}c.insert{name="blueprint",count=20}end)addButton('sendMessage',function(c,B)local rank=stringToRank(B.parent.message.rank.text)if rank then callRank(B.parent.message.message.text,rank.name)else for d,rank in pairs(ranks)do c.print(rank.name)end end end)addButton('setRanks',function(c,B)rank=stringToRank(B.parent.rank_input.text)if rank then for d,am in pairs(selected[c.index])do p=game.players[am]if getRank(c).powergetRank(c).power then giveRank(p,rank,c)else c.print('You can not edit '..p.name.."'s rank there rank is too high (or the rank you have slected is above you)")end end else c.print(B.parent.rank_input.text..' is not a Rank, Ranks are:')for d,rank in pairs(ranks)do if rank.power>getRank(c).power then c.print(rank.name)end end end end)addButton('clearSelection',function(c,B)clearSelection(c)drawPlayerTable(c,B.parent.parent,false,true,{})end)addTab('Admin','Commands','Random useful commands',function(c,B)drawButton(B,'btn_toolbar_automessage','Auto Message','Send the auto message to all online players')drawButton(B,'add_dev_items','Get Blueprints','Get all the blueprints')drawButton(B,'revive_dead_entitys_range','Revive Entitys','Brings all dead machines back to life in player range')B.add{type='textfield',name='range',text='Range'}B.add{type='flow',name='message'}B.message.add{type='textfield',name='message',text='Enter message'}B.message.add{type='textfield',name='rank',text='Enter rank'}drawButton(B,'sendMessage','Send Message','Send a message to all ranks higher than the slected')drawButton(B,'tp_all','TP All Here','Brings all players to you')end)addTab('Admin','Edit Ranks','Edit the ranks of players below you',function(c,B)clearSelection(c)B.add{name='filterTable',type='table',colspan=2}B.filterTable.add{name='name_label',type='label',caption='Name'}B.filterTable.add{name='sel_label',type='label',caption='Selected?'}B.filterTable.add{name='name_input',type='textfield'}B.filterTable.add{name='sel_input',type='textfield'}B.add{type='flow',name='rank',direction='horizontal'}B.rank.add{name='rank_label',type='label',caption='Rank'}B.rank.add{name='rank_input',type='textfield'}drawButton(B.rank,'setRanks','Set Ranks','Sets the rank of all selected players')drawButton(B.rank,'clearSelection','Clear Selection','Clears all currently selected players')drawPlayerTable(c,B,false,true,{'lower'})end)addTab('Admin','Player List','Send player message to all players',function(c,B)B.add{name='filterTable',type='table',colspan=2}B.filterTable.add{name='name_label',type='label',caption='Name'}B.filterTable.add{name='hours_label',type='label',caption='Online Time (minutes)'}B.filterTable.add{name='name_input',type='textfield'}B.filterTable.add{name='hours_input',type='textfield'}drawPlayerTable(c,B,true,false,{'online'})end)addFrame('Admin+',1,'Modifiers','Admin+',"Because we are better")addButton('remove_biters',function(c,B)for ak,al in pairs(game.surfaces[1].find_entities_filtered({force='enemy'}))do al.destroy()end end)addButton('toggle_cheat',function(c,B)c.cheat_mode=not c.cheat_mode end)addButton('revive_dead_entitys',function(c,B)for ak,al in pairs(game.surfaces[1].find_entities_filtered({type="entity-ghost"}))do al.revive()end end)addButton("btn_Modifier_apply",function(c,B)local an={"manual_mining_speed_modifier","manual_crafting_speed_modifier","character_running_speed_modifier","worker_robots_speed_modifier","worker_robots_storage_bonus","character_build_distance_bonus","character_item_drop_distance_bonus","character_reach_distance_bonus","character_resource_reach_distance_bonus","character_item_pickup_distance_bonus","character_loot_pickup_distance_bonus"}for a6,ao in pairs(an)do local ap=tonumber(B.parent.parent.modifierTable[ao.."_input"].text:match("[%d]+[.%d+]"))if ap~=nil then if ap>=0 and ap<50 and ap~=c.force[ao]then c.force[ao]=ap;c.print(ao.." changed to number: "..tostring(ap))elseif ap==c.force[ao]then c.print(ao.." Did not change")else c.print(ao.." needs to be player higher number or it contains an letter")end end end end)addTab('Admin+','Commands','Random useful commands',function(c,B)drawButton(B,'btn_toolbar_automessage','Auto Message','Send the auto message to all online players')drawButton(B,'add_dev_items','Get Blueprints','Get all the blueprints')drawButton(B,'revive_dead_entitys','Revive All Entitys','Brings all dead machines back to life')drawButton(B,'revive_dead_entitys_range','Revive Entitys','Brings all dead machines back to life in player range')B.add{type='textfield',name='range',text='Range'}drawButton(B,'remove_biters','Kill Biters','Removes all biters in map')drawButton(B,'tp_all','TP All Here','Brings all players to you')drawButton(B,'toggle_cheat','Toggle Cheat Mode','Toggle your cheat mode')end)addTab('Admin+','Modifiers','Edit in game modifiers',function(c,B)local an={"manual_mining_speed_modifier","manual_crafting_speed_modifier","character_running_speed_modifier","worker_robots_speed_modifier","worker_robots_storage_bonus","character_build_distance_bonus","character_item_drop_distance_bonus","character_reach_distance_bonus","character_resource_reach_distance_bonus","character_item_pickup_distance_bonus","character_loot_pickup_distance_bonus"}B.add{type="flow",name="flowNavigation",direction="horizontal"}B.add{name="modifierTable",type="table",colspan=3}B.modifierTable.add{name="Mname",type="label",caption="name"}B.modifierTable.add{name="input",type="label",caption="input"}B.modifierTable.add{name="current",type="label",caption="current"}for a6,ao in pairs(an)do B.modifierTable.add{name=ao,type="label",caption=ao}B.modifierTable.add{name=ao.."_input",type="textfield",caption="inputTextField"}B.modifierTable.add{name=ao.."_current",type="label",caption=tostring(c.force[ao])}end;drawButton(B.flowNavigation,"btn_Modifier_apply","Apply","Apply the new values to the game")end) \ No newline at end of file diff --git a/info.json b/info.json index 2c63c085..19765bd5 100644 --- a/info.json +++ b/info.json @@ -1,2 +1 @@ -{ -} +null diff --git a/level-init.dat b/level-init.dat index 3bd3840d..55aaa6fd 100644 Binary files a/level-init.dat and b/level-init.dat differ diff --git a/level.dat b/level.dat index 3bd3840d..3b9cac23 100644 Binary files a/level.dat and b/level.dat differ diff --git a/locale/ar/freeplay.cfg b/locale/ar/freeplay.cfg index efcd74c6..612f03e2 100644 --- a/locale/ar/freeplay.cfg +++ b/locale/ar/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=.نييلصألا ناكسلا نم كسفن ةيامح ىسنت الو ةياهنلا ىلإ لصتل كتقيرطب لمعأو ،رفصلا نم أدبتس .خيراوصلا عماوص حتف لجأ نم ةمدقتم ايجولونكت نع ثحبلل جاتحت فوس .ةيعانصلا رامقألاب خيراوصلا قالطإو خيراوصلا عماوص ءانب قيرط نع كلذب مايقلا عيطتست .ءاضفلل اخوراص قلطت نا يه كتمهم .Factorio ـل رحلا بعللا وه اذه -rocket-launched-without-satellite=.هلخادب يعانصلا رمقلا عضت مل كنكلو ،خوراصلا تقلطأ -rockets-sent=ةيعانص رامقأ قالطإ -score=ةجيتنلا diff --git a/locale/be/freeplay.cfg b/locale/be/freeplay.cfg index 5785f13d..fcc564b3 100644 --- a/locale/be/freeplay.cfg +++ b/locale/be/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Гэта рэжым свабоднай гульні Factorio. Вашая мэта - запусціць ракету ў космас. Дзеля гэтага вам трэба пабудаваць ракетную шахту і саму ракету з спадарожнікам. Вы мусіце даследваць перадавыя тэхналогіі, каб навучыцца будаваць ракетную шахту. Пачынайце з малога, працуйце над аўтаматызацыяй вытворчасці, даследуйце новыя тэхналогіі і не забывайцеся на абарону ад "тутэйшых"! -rocket-launched-without-satellite=Вы запусцілі ракету, аднак не змясцілі ў ёй спадарожнік. -rockets-sent=Запушчана спадарожнікаў -score=Вынік diff --git a/locale/bg/freeplay.cfg b/locale/bg/freeplay.cfg index fd4f9bfe..219fd494 100644 --- a/locale/bg/freeplay.cfg +++ b/locale/bg/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Това е режимът на свободна игра. Задачата ви е да изстреляте ракета в космоса. За това ще е нужно да построите ракетна шахта и изстреляте ракетата със спътник. Ще трябва да проучите развити технологии, които ще отключат ракетната шахта. Започнете с малко и постепенно автоматизирайте процеса, като не забравяте да се защитавате от местните форми на живот. -rocket-launched-without-satellite=Изстреляхте ракетата, но не сложихте спътник. -rockets-sent=Изстреляни спътници -score=Резултат diff --git a/locale/ca/freeplay.cfg b/locale/ca/freeplay.cfg index 838ec2eb..923fb552 100644 --- a/locale/ca/freeplay.cfg +++ b/locale/ca/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Aquest és el mode lliure del Factorio. La vostra tasca és construir un coet i enviar-lo a l'espai. Ho haureu de fer construint un centre de coets espacials i llençant un coet amb un satèl·lit. Necessitareu investigar tecnologies avançades per poder-ho fer. Aneu pas a pas, avanceu cap a l'automatització i no oblideu protegir-vos dels natius. -rocket-launched-without-satellite=S'ha llençat el coet, però no hi heu posat un satèl·lit a dins. -rockets-sent=Satèl·lits llançats -score=Puntuació diff --git a/locale/cs/freeplay.cfg b/locale/cs/freeplay.cfg index 651b4f8b..07164f2b 100644 --- a/locale/cs/freeplay.cfg +++ b/locale/cs/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Toto je volná hra Factorio. Tvým úkolem je vypustit raketu do vesmíru. Postav raketové silo a vypusť raketu se satelitem. Pro odemknutí raketového sila budeš muset vyzkoumat pokročilé technologie. Začni v malém, postupuj s automatizací a nezapomeň se chránit před domorodci. -rocket-launched-without-satellite=Poslal jsi raketu, ale nedal jsi dovnitř satelit. -rockets-sent=Satelity vypuštěny -score=Skóre diff --git a/locale/da/freeplay.cfg b/locale/da/freeplay.cfg index 9aca353c..37490dbe 100644 --- a/locale/da/freeplay.cfg +++ b/locale/da/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Det her er Factorio fri leg. Din opgave er at affyre en raket for at udforske rummet. For at gøre det skal du bygge en raket silo og affyre en raket med en satellit i. Du bliver nød til at udforske avancerede teknologier for at at kunne bygge en raket silo. Start småt, og arbejd din vej op med hjælp af automatisering, glem ikke at beskytte dig fra de indfødte. -rocket-launched-without-satellite=Du affyrede raketten, men du glemte at placere en satellit i den. -rockets-sent=Satellitter opsendt -score=Point diff --git a/locale/de/freeplay.cfg b/locale/de/freeplay.cfg index 702ab082..df819fcb 100644 --- a/locale/de/freeplay.cfg +++ b/locale/de/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Dies ist das freie Spiel von Factorio. Deine Aufgabe ist es, eine Rakete in den Weltraum zu starten. Dazu musst du ein Raketensilo bauen und eine Rakete mit einem Satelliten starten. Du wirst erweiterte Technologien erforschen müssen um das Raketensilo freizuschalten. Fange klein an, arbeite dich durch Automatisierung hoch und vergiss nicht, dich vor den Einheimischen zu schützen. -rocket-launched-without-satellite=Du hast die Rakete gestartet, aber keinen Satelliten vorher eingesetzt. -rockets-sent=Satelliten gestartet -score=Punktestand diff --git a/locale/el/freeplay.cfg b/locale/el/freeplay.cfg index 53d4ed77..a714c2cb 100644 --- a/locale/el/freeplay.cfg +++ b/locale/el/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Αυτό είναι το ελεύθερο παιχνίδι του Factorio. Ο στόχος σας είναι να εκτοξεύσετε έναν πύραυλο στο διάστημα. Αυτό το κάνετε με την κατασκευή ενός σιλό πυραύλων και την εκτόξευση ενός πυραύλου με δορυφόρο. Θα πρέπει να ερευνήσετε τις προηγμένες τεχνολογίες για να ξεκλειδώσετε το σιλό πυραύλων. Ξεκινήστε μικρά, δουλέψτε στο δρόμο σας επάνω με την αυτοματοποίηση και μην ξεχάσετε να προστατέψετε τον εαυτό σας από τους ντόπιους. -rocket-launched-without-satellite=Εκτόξευσες τον πύραυλο, αλλά δεν έβαλες έναν δορυφόρο μέσα. -rockets-sent=Οι δορυφόροι εκτοξεύτικαν -score=Σκορ diff --git a/locale/en/freeplay.cfg b/locale/en/freeplay.cfg index b584b167..ffe14750 100644 --- a/locale/en/freeplay.cfg +++ b/locale/en/freeplay.cfg @@ -1,4 +1 @@ msg-intro=This is the Factorio freeplay. Your task is to launch a rocket into space. Do this by constructing a Rocket Silo and launching a rocket with a satellite. You will need to research advanced technologies in order to unlock the Rocket Silo. Start small, work your way up with automation and don't forget to protect yourself from the natives. -rocket-launched-without-satellite=You launched the rocket, but you didn't put a satellite inside. -score=Score -rockets-sent=Satellites launched diff --git a/locale/eo/freeplay.cfg b/locale/eo/freeplay.cfg index 08435eba..5c38f105 100644 --- a/locale/eo/freeplay.cfg +++ b/locale/eo/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Tio estas la Factorio Freeplay. Via tasko estas ĵeti raketon en spacon. Fari tiun per konstruanta Raketo Silo kaj ĵeti raketon kun satelito. Vi bezonos esplori altnivelaj teknologioj por malŝlosi la Raketo Silo. Start malgranda, labori vian vojon supren per aŭtomatigo kaj ne forgesu protekti vin mem de la indiĝenoj. -rocket-launched-without-satellite=Vi lanĉis la raketon, sed vi ne metis sateliton ene. -rockets-sent=Satelitoj lanĉis -score=Partituro diff --git a/locale/es-ES/freeplay.cfg b/locale/es-ES/freeplay.cfg index 78aab16b..9822231a 100644 --- a/locale/es-ES/freeplay.cfg +++ b/locale/es-ES/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Este es el modo de juego libre de Factorio. Tu tarea es la de lanzar un cohete al espacio. Logra esto construyendo un Silo de Cohetes y lanzando un cohete con un satélite. Necesitarás investigar tecnologías avanzadas para poder desbloquear el Silo de Cohetes. Comienza poco a poco, trabaja en tu sistema de automatización y no te olvides de protegerte de los nativos. -rocket-launched-without-satellite=Lanzaste el cohete, pero no colocaste un satélite dentro. -rockets-sent=Satélites lanzados -score=Puntuación diff --git a/locale/et/freeplay.cfg b/locale/et/freeplay.cfg index 79152526..c3a45120 100644 --- a/locale/et/freeplay.cfg +++ b/locale/et/freeplay.cfg @@ -1,4 +1,2 @@ msg-intro=See on Factorio vabamängumood. Sinu eesmärgiks on saata rakett avakosmosesse. Seda saad teha ehitades Raketti Silotorni ja heites rakketi koos satelliidiga. Selleks pead õppima selgeks keerukad tehnoloogiaharud, et Raketti Silotorni lahti lukustada. Alusta väikselt, tööta selle kallal automatsiooni abil ja ära unusta ennast kaitsta kohalike eluvormide eest. -rocket-launched-without-satellite=Sa lennutasid raketi teele, aga ei pannud selle sisse satelliidi. -score=Skoor diff --git a/locale/fi/freeplay.cfg b/locale/fi/freeplay.cfg index 3f3e7803..6e983ac6 100644 --- a/locale/fi/freeplay.cfg +++ b/locale/fi/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Tämä on Factorion vapaapelimuoto. Tavoitteesi on lähettää satelliitti ulkoavaruuteen rakentamalla rakettisiilo ja laukaisemalla raketti. Rakettisiilon voit rakentaa vasta, kun olet kehittänyt siihen tarvittavat huipputeknologiat. Aloita pienestä ja automatisoi kaikki tarvittava, äläkä unohda suojella itseäsi alkuasukkailta. -rocket-launched-without-satellite=Laukaisit raketin, mutta et laittanut satelliittia sen sisään. -rockets-sent=Satelliitteja laukaistu -score=Pistemäärä diff --git a/locale/fr/freeplay.cfg b/locale/fr/freeplay.cfg index 16eb0901..4886258e 100644 --- a/locale/fr/freeplay.cfg +++ b/locale/fr/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Il s'agit du mode de jeu libre de Factorio. Votre tâche consiste à lancer une fusée dans l'espace. Ceci en construisant un silo à fusée, et en lançant un satellite avec la fusée. Vous aurez besoin de rechercher des technologies de pointe afin de débloquer le silo. Commencez petit, évoluez en automatisant et n'oubliez pas de vous protéger contre les autochtones. -rocket-launched-without-satellite=Vous avez lancé la fusée, mais vous n'avez pas mis de satellite à l'intérieur. -rockets-sent=Satellites lancés -score=Score diff --git a/locale/he/freeplay.cfg b/locale/he/freeplay.cfg index 27216b9e..16486f7e 100644 --- a/locale/he/freeplay.cfg +++ b/locale/he/freeplay.cfg @@ -1,5 +1,2 @@ -msg-intro=.םיימוקמה םירוציה ינפמ םכמצע לע ןגהל וחכשת לאו ,יטמוטוא ןוכימ תועצמאב םכלש הישעתה תא וביחרה ,ןטקב וליחתה .ןקתמה תיינב תא רשפאל ידכ תומדקתמ תויגולונכט רוקחל םכילע היהי .ןייוול ליכמה ליט ותועצמאב רגשלו םיליט רוגיש ןקתמ תונבל םכילע .ללחה רקחל שמשיש ליט חולשל איה םכתמישמ .ויִרֹוטְקַפ לש ישפוחה שיחרתה והז -rocket-launched-without-satellite=.ןייוול המינפ תסנכה אל ךא ,ליטה תא תרגיש -rockets-sent=ורגושש םיניוול -score=דוקינ +msg-intro=.םיימוקמה ינפמ םכמצע לע ןגהל וחכשת לאו ,יטמוטוא ןוכימ תועצמאב םכלש הישעתה תא וביחרה ,ןטקב וליחתה .ןקתמה תיינב תא רשפאל ידכ תומדקתמ תויגולונכט רוקחל םכילע היהי .ןייוול ליכמה ליט ותועצמאב רגשלו םיליט רוגיש ןקתמ תונבל םכילע .ללחה לא ליט חולשל איה םכתמישמ .ויִרֹוטְקַפ לש ישפוחה שיחרתה והז diff --git a/locale/hu/freeplay.cfg b/locale/hu/freeplay.cfg index c7730ae8..17a08f9a 100644 --- a/locale/hu/freeplay.cfg +++ b/locale/hu/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Ez a Factorio szabad játék módja. A feladatod az, hogy kilőj egy rakétát az űr felderítésére. Ehhez egy Rakétasilót kell építened, melyből aztán egy műholddal felszerelt rakétát kell kilőnöd. A Rakétasiló kifejlesztéséhez különféle technológiákat kell fejlesztened. Kezdj kicsiben és küzdd fel magad az automatizálásban. Ne felejts el védekezni a honos fajok ellen. -rocket-launched-without-satellite=Kilőtted a rakétát, de nem helyeztél el benne műholdat. -rockets-sent=Műholdak elindítva -score=Pontszám diff --git a/locale/it/freeplay.cfg b/locale/it/freeplay.cfg index 30fe5d1f..c4c27e01 100644 --- a/locale/it/freeplay.cfg +++ b/locale/it/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Questa è la modalità libera di Factorio. Il tuo obiettivo è quello di lanciare il razzo nello spazio. Completalo costruendo un Silo per Razzi e lanciando il razzo con il satellite. Avrai bisogno di ricercare tecnologie avanzate per riuscire a sbloccare il Silo per Razzi. Inizia in piccolo, espandi con l'automazione e non dimenticare di proteggerti dai nativi. -rocket-launched-without-satellite=Hai lanciato il razzo, ma non hai inserito il satellite al suo interno. -rockets-sent=Satellite lanciato -score=Punteggio diff --git a/locale/ja/freeplay.cfg b/locale/ja/freeplay.cfg index 719734bf..1d545443 100644 --- a/locale/ja/freeplay.cfg +++ b/locale/ja/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=これは、Factorioのフリープレイです。ロケットサイロを建造し、衛星を載せたロケットを宇宙へ打ち上げるのがあなたの任務です。ロケットサイロをアンロックするためには高度な技術研究をする必要があります。小規模に始め、自動化しつつ進み、原住生物から身を守ることも忘れないでください。 -rocket-launched-without-satellite=衛星を積まずにロケットを打ち上げてしまいました。 -rockets-sent=打ち上げた衛星 -score=スコア diff --git a/locale/ko/freeplay.cfg b/locale/ko/freeplay.cfg index 78531d5f..0f3188f4 100644 --- a/locale/ko/freeplay.cfg +++ b/locale/ko/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Factorio 자유플레이입니다. 당신의 목표는 우주로 로켓을 발사하는 것입니다. 로켓 격납고를 건설하고 인공위성을 탑재한 로켓을 발사해서 이 목표를 달성하세요. 로켓 격납고의 잠금을 해제하기 위해 고급 기술들을 연구할 필요가 있습니다. 작은 것부터 시작해 자동화로 차근차근 발전하고, 토착 생물들로부터 자신을 보호하는 것도 잊지 마세요. -rocket-launched-without-satellite=로켓을 발사했지만, 로켓 내부에 인공위성을 넣지 않았습니다. -rockets-sent=발사된 인공위성 -score=점수 diff --git a/locale/lt/freeplay.cfg b/locale/lt/freeplay.cfg index 9d082ddb..3ddb933b 100644 --- a/locale/lt/freeplay.cfg +++ b/locale/lt/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Tai Factorio laisvas žaidimas. Jūsų užduotis - paleisti raketą į kosmosą. Tam reikia pastatyti Raketos šachtą ir paleisti raketą su palydovu. Reikės atrasti pažangias technologijas kad atrakintumėte Raketos šachtą. Pradėkite palengva, tobulinkite automatiką ir neužmirškite apsisaugoti nuo vietinių. -rocket-launched-without-satellite=Paleidote raketą, bet neįdėjote palydovo į ja. -rockets-sent=Palydovai paleisti -score=Rezultatas diff --git a/locale/lv/freeplay.cfg b/locale/lv/freeplay.cfg index b6dab311..581e4b52 100644 --- a/locale/lv/freeplay.cfg +++ b/locale/lv/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Šis ir Factorio brīvais režīms. Tavs uzdevums ir palaist raķeti kosmosā. Lai to izdarītu, tev vajadzēs uzbūvēt palaišanas platformu un palaist raķeti ar satelītu. Tev būs jāizpēta sarežģītas tehnoloģijas, lai atbloķētu palaišanas platformu. Sāc no mazumiņa, strādā un neaizmirsti pasargāt sevi no šīs planētas iemītniekiem... -rocket-launched-without-satellite=Tu palaidi raķeti, bet neievietoji tajā satelītu. -rockets-sent=Satelīti palaidās -score=Rezultāts diff --git a/locale/nl/freeplay.cfg b/locale/nl/freeplay.cfg index e69de347..3c22639b 100644 --- a/locale/nl/freeplay.cfg +++ b/locale/nl/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Dit is Factorio vrij spel. Je taak is om een raket te lanceren in de ruimte. Bouw hiervoor een raket-silo en lanceer een raket met een satelliet. Je zult geavanceerde technologieën moeten onderzoeken om de raket-silo vrij te spelen. Begin op kleine schaal, breidt uit en automatiseer je fabriek en vergeet niet jezelf te beschermen tegen de inheemse bewoners. -rocket-launched-without-satellite=Je hebt de raket gelanceerd, maar zonder een satelliet aan boord te brengen. -rockets-sent=Satellieten gelanceerd -score=Score diff --git a/locale/no/freeplay.cfg b/locale/no/freeplay.cfg index 5efcf6e5..876e2f4e 100644 --- a/locale/no/freeplay.cfg +++ b/locale/no/freeplay.cfg @@ -1,5 +1,2 @@ -msg-intro=Dette er Factorio frispilling. Din oppgave er å sende en rakett til verdensrommet. Bygg en rakettsilo og send opp en rakett med en satellitt på. Du blir nødt til å utforske avanserte teknologier for å få tilgang til rakettsiloen. Begynn i det små, jobb deg oppover med hjelp av automatisering og ikke glem å beskytte deg mot de innfødte. -rocket-launched-without-satellite=Du skjøt opp raketten, men du satte ikke inn en satelitt. -rockets-sent=Satellitter skutt ut -score=Poengsum +msg-intro=Dette er Factorio frispilling. Din oppgave er å sende en rakett til verdensrommet. Bygg en rakettsilo og send opp en rakett med en satellitt. Du blir nødt til å utforske avanserte teknologier for å få tilgang til rakettsiloen. Begynn i det små, jobb deg oppover med hjelp av automatisering og ikke glem å beskytte deg mot de innfødte. diff --git a/locale/pl/freeplay.cfg b/locale/pl/freeplay.cfg index 4b1b1e0d..7c1d92b6 100644 --- a/locale/pl/freeplay.cfg +++ b/locale/pl/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=To jest swobodna rozgrywka Factorio. Twoim zadaniem jest wysłanie rakiety w kosmos. Skonstruuj silos rakietowy i wystrzel z niego rakietę z satelitą. Żeby odblokować silos rakietowy będziesz musiał odkryć zaawansowane technologie. Rozpocznij od podstaw, rozwijaj się wykorzystując automatyzację i nie zapomnij o obronie przed rodzimymi mieszkańcami planety. -rocket-launched-without-satellite=Wystrzeliłeś rakietę, ale nie umieściłeś w niej satelity. -rockets-sent=Wysłane satelity -score=Wynik diff --git a/locale/pt-BR/freeplay.cfg b/locale/pt-BR/freeplay.cfg index 168a16db..c59d512c 100644 --- a/locale/pt-BR/freeplay.cfg +++ b/locale/pt-BR/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Este é o modo livre do Factorio. Sua missão é lançar um foguete no espaço. Para fazer isso construa um centro de lançamento de foguetes e lance o foguete com um satélite. Você vai precisar pesquisar tecnologias avançadas para conseguir desbloquear um Centro de lançamento. Comece do começo, continue na automação e não se esqueça de se proteger dos nativos. -rocket-launched-without-satellite=Você lançou o foguete, mas não colocou o satélite dentro. -rockets-sent=Satélites lançados -score=Pontuação diff --git a/locale/pt-PT/freeplay.cfg b/locale/pt-PT/freeplay.cfg index ce7c9f83..7faa1fce 100644 --- a/locale/pt-PT/freeplay.cfg +++ b/locale/pt-PT/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Este é o jogo livre Factorio. A tua tarefa é lançar um foguetão para explorar o espaço. Faça isto, construindo um Silo de Foguetão e lançar um foguetão com um satélite. Tu vais precisar de pesquisar tecnologias avançadas para poderes desbloquear o Silo de Foguetão. Começa simples, trabalha e evolui com a automação e não te esqueças de proteger-te dos nativos. -rocket-launched-without-satellite=Lançou o foguetão, mas não colocou um satélite lá dentro. -rockets-sent=Satélites lançados -score=Pontuação diff --git a/locale/ro/freeplay.cfg b/locale/ro/freeplay.cfg index 0f582237..1d226e8c 100644 --- a/locale/ro/freeplay.cfg +++ b/locale/ro/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Acesta este modul Factorio freeplay. Sarcina ta este de a lansa o rachetă în spațiu. Fă acest lucru prin construirea unui siloz de rachete și lansarea unei rachete cu satelit. Va trebui să cercetezi tehnologiile avansate pentru a debloca silozul de rachete. Începe încet, avansează cu automatizarea și nu uita să te protejezi de inamici. -rocket-launched-without-satellite=Ai lansat racheta, dar nu ai pus și satelitul în interior. -rockets-sent=Sateliții au fost lansați -score=Scor diff --git a/locale/ru/freeplay.cfg b/locale/ru/freeplay.cfg index 77931e05..5266aa77 100644 --- a/locale/ru/freeplay.cfg +++ b/locale/ru/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Это режим свободной игры Factorio. Ваша задача запустить спутник в космос. Для его запуска потребуется создать ракету и ракетную шахту. Начните с малого, работайте над автоматизацией производства, исследуйте новые технологии и не забывайте о защите от местных форм жизни. -rocket-launched-without-satellite=Вы запустили ракету, но не поместили спутник в неё. -rockets-sent=Спутников запущено -score=Счёт diff --git a/locale/sr/freeplay.cfg b/locale/sr/freeplay.cfg index f9cd949b..3a449cd4 100644 --- a/locale/sr/freeplay.cfg +++ b/locale/sr/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Ово је Factorio freeplay. Твој задатак је да лансираш ракету са сателитом у свемир. Уради ово грађом ракетног силоса. Треба да истражиш пуно напредних технологија да би откључао ракетни силос. Почни мало, а онда напредуј са аутоматизацијом и не заборави да се заштитиш од ванземаљаца. -rocket-launched-without-satellite=Лансирао си ракету али ниси ставио сателит унутра. -rockets-sent=Satelit lansiran -score=Rezultat diff --git a/locale/sv-SE/freeplay.cfg b/locale/sv-SE/freeplay.cfg index d205ceed..5081d889 100644 --- a/locale/sv-SE/freeplay.cfg +++ b/locale/sv-SE/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Det här är Factorio frispel. Ditt uppdrag är att avfyra en raket till rymden. Gör det genom att tillverka en raket silo och avfyra en raket med en satellit. Du kommer att behöva forska fram avancerade teknologier för att låsa upp raket silon. Börja litet, jobba dig uppåt med hjälp av automatisering och glöm inte att försvara dig själv mot infödingarna. -rocket-launched-without-satellite=Du avfyrade raketen, men du satte aldrig i en satellit. -rockets-sent=Satelliter uppskjutna -score=Poäng diff --git a/locale/th/freeplay.cfg b/locale/th/freeplay.cfg index ad442468..2bb63126 100644 --- a/locale/th/freeplay.cfg +++ b/locale/th/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=นี้คือโหมดอิสระของ Factorio ภารกิจของคุณคือส่งจรวดสู่อวกาศ ซึ่งทำได้โดยการสร้างไซโลจรวดและส่งจรวดขึ้นไปพร้อมกับดาวเทียม คุณต้องวิจัยค้นคว้าเทคโนโลยีขั้นสูงเพื่อปลดล็อคไซโลจรวด เริ่มจากเล็กๆไปเรื่อยๆด้วยระบบอัตโนมัติและอย่าลืมป้องกันตัวเองจากคนพื้นเมืองด้วย -rocket-launched-without-satellite=คุณสั่งใช้งานจรวดแล้ว แต่คุณยังไม่ได้ติดตั้งดาวเทียมภายในตัวจรวด -rockets-sent=ส่งดาวเทียมเรียบร้อย -score=คะแนน diff --git a/locale/tr/freeplay.cfg b/locale/tr/freeplay.cfg index 6cea3487..f57e33ad 100644 --- a/locale/tr/freeplay.cfg +++ b/locale/tr/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Bu Factorio'nun serbest oynanışı. Görevin roketleri uzaya yollamak. Bunu Roket Silosu yaparak ve uyduyla roket yollayarak yapacaksın. Roket Silo'sunu açmak için gelişmiş teknolojileri sırayla açmalısın. Yavaş başla, otomatikleş ve yerlilerden kendini korumayı untuma. -rocket-launched-without-satellite=Roketi yolladın, ama içine uydu koymadın. -rockets-sent=Uydu fırlatıldı -score=Skor diff --git a/locale/uk/freeplay.cfg b/locale/uk/freeplay.cfg index f5f07206..a550ef55 100644 --- a/locale/uk/freeplay.cfg +++ b/locale/uk/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Це один з типів гри в Factorio - "Вільна гра". Ваше завдання - запустити ракету у космічний простір. Зробіть це, побудувавши ракетну шахту та запустивши ракету зі супутником. Вам потрібно дослідити передові технології, щоб мати змогу побудувати ракетну шахту. Починайте з малого, розвивайтеся за допомогою автоматизації, але не забувайте і про оборону! -rocket-launched-without-satellite=Ви запустили ракету, однак не завантажили супутник всередину. -rockets-sent=Супутники запущені -score=Рахунок diff --git a/locale/vi/freeplay.cfg b/locale/vi/freeplay.cfg index a4607987..a354e0db 100644 --- a/locale/vi/freeplay.cfg +++ b/locale/vi/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=Đầy là chế độ freeplay của Factorio. Nhiệm cụ của bạn là phóng một chiếc tên lửa lên vũ trụ. Hãy xây dựng một bệ phóng tên lửa để phóng một chiếc tên lửa kèm theo vệ tinh. Bạn sẽ cần phải nghiên cứu nhiều công nghệ tiên tiến để có thể xây dựng bệ phóng tên lửa. Bắt đầu từ quy mô nhỏ, phát triển dần dần bằng tự động hóa, và đừng quên bảo vệ bản thân mình khỏi những sinh vật sinh sống ở đây. -rocket-launched-without-satellite=Bạn đã phóng tên lửa, nhưng bạn đã không đặt vệ tinh vào trong. -rockets-sent=Vệ tinh đã phóng -score=Điểm số diff --git a/locale/zh-CN/freeplay.cfg b/locale/zh-CN/freeplay.cfg index b0e233b7..1e1b36a4 100644 --- a/locale/zh-CN/freeplay.cfg +++ b/locale/zh-CN/freeplay.cfg @@ -1,5 +1,2 @@ -msg-intro=欢迎来到 Factorio 标准模式 (freeplay) ,您的目标是要把火箭发射到太空。为此,您需要研发一系列高等科技,解锁并修建火箭发射井,直到把携带有卫星的火箭发射出去。从小作坊生产起步,逐渐建立起属于自己的自动化大工厂吧!同时,别忘了防范异星虫子的骚扰 ... -rocket-launched-without-satellite=您已经发射了火箭,但并未将卫星置于其中。 -rockets-sent=已发射卫星 -score=得分 +msg-intro=欢迎来到 Factorio 标准模式 (freeplay) ,你的目标是要把火箭发射到太空。为此你需要研发一系列高等科技,解锁并修建火箭发射井,直到把携带有卫星的火箭发射出去。从小作坊生产起步,逐渐建立起属于自己的自动化大工厂吧!同时,别忘了防范异星虫子的骚扰 ... diff --git a/locale/zh-TW/freeplay.cfg b/locale/zh-TW/freeplay.cfg index 85dea3d4..b83dca41 100644 --- a/locale/zh-TW/freeplay.cfg +++ b/locale/zh-TW/freeplay.cfg @@ -1,5 +1,2 @@ msg-intro=這是異星工廠的自由模式。你的任務是發射火箭探索外太空。請建造一個火箭發射井並於攜帶衛星後發射。你會需要研究大量的進階科技以解鎖火箭發射井。從頭開始,靠著自動化的協助邁向目標的同時,也別忘了從外星住民手中保護你自己。 -rocket-launched-without-satellite=你發射了火箭,但是你沒有把衛星放在裡面。 -rockets-sent=發射衛星 -score=分數 diff --git a/preview.png b/preview.png new file mode 100644 index 00000000..c57a4045 Binary files /dev/null and b/preview.png differ diff --git a/script.dat b/script.dat index b5a60d42..ebac4e5d 100644 Binary files a/script.dat and b/script.dat differ diff --git a/source.lua b/source.lua index f0de436b..7edd8bf1 100644 --- a/source.lua +++ b/source.lua @@ -64,40 +64,12 @@ function saveVar() game.players[1].gui.left.hidden.caption = table.tostring(gTable) end ---------------------------------------------------------------------------------------- ----------------------------Remove decorations------------------------------------------- ----------------------------------------------------------------------------------------- -local function removeDecorationsArea(surface, area ) - if surface.find_entities_filtered{area = area, type="decorative"} then - for _, entity in pairs(surface.find_entities_filtered{area = area, type="decorative"}) do - if (entity.name ~= "red-bottleneck" and entity.name ~= "yellow-bottleneck" and entity.name ~= "green-bottleneck") then - entity.destroy() - end - end - end -end - -local function removeDecorations(surface, x, y, width, height ) - removeDecorationsArea(surface, {{x, y}, {x + width, y + height}}) -end - -local function clearDecorations() - local surface = game.surfaces["nauvis"] - for chunk in surface.get_chunks() do - removeDecorations(surface, chunk.x * CHUNK_SIZE, chunk.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(event) - removeDecorationsArea( event.surface, event.area ) -end) ----------------------------------------------------------------------------------------- ---------------------------Rank functions----------------------------------------------- ---------------------------------------------------------------------------------------- function getRank(player) if player then for _,rank in pairs(ranks) do - if player.tag == rank.tag then return rank end + if player.permission_group == game.permissions.get_group(rank.name) then return rank end end return stringToRank('Guest') end @@ -142,7 +114,7 @@ function giveRank(player,rank,byPlayer,sys) else callRank(player.name..' was '..message..' to '..rank.name..' by ',oldRank.name) end - player.tag = rank.tag + player.permission_group = game.permissions.get_group(rank.name) drawToolbar(player) drawPlayerList() if sys then else @@ -171,10 +143,10 @@ function autoRank(player) end if playerAutoRank then if currentRank.power > playerAutoRank.power then - player.tag=playerAutoRank.tag + player.permission_group=game.permissions.get_group(playerAutoRank.name) end elseif ticktominutes(player.online_time) >= timeForRegular then - player.tag=stringToRank('Regular').tag + player.permission_group=game.permissions.get_group('Regular') end if getRank(player).power <= 3 and not player.admin then callRank(player.name..' needs to be promoted.') @@ -183,7 +155,7 @@ function autoRank(player) jail[player.index]={false,getRank(player).name} end if jail[player.index][1] then - player.tag=stringToRank('Jail').tag + player.permission_group=game.permissions.get_group('Jail') if player.character then player.character.active = false end end saveVar() @@ -299,7 +271,7 @@ function openTab(player, frameName, tab, tabName) if _ ~= 1 then if t[1] == tabName then tabBar[t[1]].style.font_color = {r = 255, g = 255, b = 255, player = 255} - clearElement(tab) + tab.clear() t[3](player, tab) else tabBar[t[1]].style.font_color = {r = 100, g = 100, b = 100, player = 255} @@ -340,14 +312,6 @@ function toggleVisable(frame) end end end - -function clearElement (elementToClear) - if elementToClear ~= nil then - for i, element in pairs(elementToClear.children_names) do - elementToClear[element].destroy() - end - end -end ---------------------------------------------------------------------------------------- ---------------------------Player Events------------------------------------------------ ---------------------------------------------------------------------------------------- @@ -358,7 +322,7 @@ script.on_event(defines.events.on_player_created, function(event) player.insert{name="firearm-magazine", count=10} player.insert{name="burner-mining-drill", count = 1} player.insert{name="stone-furnace", count = 1} - player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}}) + player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}}) end) script.on_event(defines.events.on_player_respawned, function(event) @@ -370,6 +334,11 @@ end) script.on_event(defines.events.on_player_joined_game, function(event) loadVar() + if #game.players == 1 then + for _,rank in pairs(ranks) do + game.permissions.create_group(rank.name) + end + end local player = game.players[event.player_index] autoRank(player) player.print({"", "Welcome"}) @@ -555,12 +524,10 @@ end ---------------------------Tool Bar----------------------------------------------------- ---------------------------------------------------------------------------------------- addButton("btn_toolbar_playerList", function(player) toggleVisable(player.gui.left.PlayerList) end) -addButton("btn_toolbar_rocket_score",function(player) toggleVisable(player.gui.left.rocket_score) end) function drawToolbar(player) local frame = player.gui.top - clearElement(frame) + frame.clear() drawButton(frame,"btn_toolbar_playerList", "Playerlist", "Adds player player list to your game.") - drawButton(frame,"btn_toolbar_rocket_score", "Rocket score", "Show the satellite launched counter if player satellite has launched.") for _,f in pairs(guis.frames) do if getRank(player).power <= f[1].require then drawButton(frame,"btn_".._, f[1].caption, f[1].tooltip) end end @@ -575,7 +542,7 @@ function drawPlayerList() .add{type = "scroll-pane", name= "PlayerListScroll", direction = "vertical", vertical_scroll_policy="always", horizontal_scroll_policy="never"} end Plist= player.gui.left.PlayerList.PlayerListScroll - clearElement(Plist) + Plist.clear() Plist.style.maximal_height = 200 for i, player in pairs(game.connected_players) do playerRank = getRank(player) @@ -621,7 +588,7 @@ function drawPlayerTable(player, frame, commands, select,filters) frame.playerTable.style.maximal_width = 500 frame.playerTable.style.horizontal_spacing = 10 frame.playerTable.add{name="id", type="label", caption="Id "} - frame.playerTable.add{name="name", type="label", caption="Name "} + frame.playerTable.add{name="Pname", type="label", caption="Name "} if commands==false and select ==false then frame.playerTable.add{name="status", type="label", caption="Status "} end frame.playerTable.add{name="online_time", type="label", caption="Online Time "} frame.playerTable.add{name="rank", type="label", caption="Rank "} @@ -875,7 +842,7 @@ addTab('Admin+', 'Modifiers', 'Edit in game modifiers', } frame.add{type = "flow", name= "flowNavigation",direction = "horizontal"} frame.add{name="modifierTable", type="table", colspan=3} - frame.modifierTable.add{name="name", type="label", caption="name"} + frame.modifierTable.add{name="Mname", type="label", caption="name"} frame.modifierTable.add{name="input", type="label", caption="input"} frame.modifierTable.add{name="current", type="label", caption="current"} for i, modifier in pairs(forceModifiers) do