mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 23:54:52 +09:00
Merge pull request #1 from badgamernl/WIP
Testing - New Button - Test Push To Testing From WIP
This commit is contained in:
commit
faaecc5fb1
2 files changed
+3
-6
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
itemRotated={}entityRemoved={}entityCache={}guis={frames={},buttons={}}warningAllowed=nil;timeForRegular=180;CHUNK_SIZE=32;local function a(b,c)if b.find_entities_filtered{area=c,type="decorative"}then for d,e in pairs(b.find_entities_filtered{area=c,type="decorative"})do if e.name~="red-bottleneck"and e.name~="yellow-bottleneck"and e.name~="green-bottleneck"then e.destroy()end end end end;local function f(b,g,h,i,j)a(b,{{g,h},{g+i,h+j}})end;local function k()local b=game.surfaces["nauvis"]for l in b.get_chunks()do f(b,l.x*CHUNK_SIZE,l.y*CHUNK_SIZE,CHUNK_SIZE-1,CHUNK_SIZE-1)end;callAdmin("Decoratives have been removed")end;script.on_event(defines.events.on_chunk_generated,function(m)a(m.surface,m.area)end)function ticktohour(n)local o=tostring(math.floor(n*1/(60*game.speed)/3600))return o end;function ticktominutes(n)local p=math.floor(n*1/(60*game.speed)/60)return p end;function callAdmin(q)for d,r in pairs(game.connected_players)do if r.admin then r.print(q)end end end;function autoMessage()game.print('There are '..#game.connected_players..' players online')game.print('This map has been on for '..ticktohour(game.tick)..' Hours and '..ticktominutes(game.tick)-60*ticktohour(game.tick)..' Minutes')game.print('Please join us on:')game.print('Discord: https://discord.gg/RPCxzgt')game.print('Forum: explosivegaming.nl')game.print('Steam: http://steamcommunity.com/groups/tntexplosivegaming')game.print('To see these links again goto: Readme > Server Info')end;function addFrame(s)guis.frames[s]={}addButton('close',function(r,t)t.parent.parent.parent.destroy()end)end;function addTab(s,u,v,w)guis.frames[s][u]={u,v,w}addButton(u,function(r,t)openTab(r,t.parent.parent.parent.name,t.parent.parent.parent.tab,t.name)end)end;function addButton(x,y)guis.buttons[x]={x,y}end;function drawButton(s,x,z,v)s.add{name=x,type="button",caption=z,tooltip=v}end;function openTab(r,A,B,u)local C=r.gui.center[A].tabBarScroll.tabBar;for d,D in pairs(guis.frames[A])do if D[1]==u then C[D[1]].style.font_color={r=255,g=255,b=255,a=255}clearElement(B)D[3](r,B)else C[D[1]].style.font_color={r=100,g=100,b=100,a=255}end end end;function drawFrame(r,A,u)if r.gui.center[A]then r.gui.center[A].destroy()end;local s=r.gui.center.add{name=A,type='frame',caption=A,direction='vertical'}local E=s.add{type="scroll-pane",name="tabBarScroll",vertical_scroll_policy="never",horizontal_scroll_policy="always"}local C=E.add{type='flow',direction='horizontal',name='tabBar'}local B=s.add{type="scroll-pane",name="tab",vertical_scroll_policy="auto",horizontal_scroll_policy="never"}for d,D in pairs(guis.frames[A])do drawButton(C,D[1],D[1],D[2])end;openTab(r,A,B,u)drawButton(C,'close','Close','Close this window')B.style.minimal_height=300;B.style.maximal_height=300;B.style.minimal_width=500;B.style.maximal_width=500;E.style.minimal_height=60;E.style.maximal_height=60;E.style.minimal_width=500;E.style.maximal_width=500 end;function toggleVisable(s)if s then if s.style.visible==nil then s.style.visible=false else s.style.visible=not s.style.visible end end end;function clearElement(F)if F~=nil then for G,t in pairs(F.children_names)do F[t].destroy()end end end;script.on_event(defines.events.on_player_created,function(m)local r=game.players[m.player_index]r.insert{name="iron-plate",count=8}r.insert{name="pistol",count=1}r.insert{name="firearm-magazine",count=10}r.insert{name="burner-mining-drill",count=1}r.insert{name="stone-furnace",count=1}if r.name=="badgamernl"or r.name=="BADgamerNL"then r.insert{name="blueprint",count=1}r.insert{name="deconstruction-planner",count=1}end;r.force.chart(r.surface,{{r.position.x-200,r.position.y-200},{r.position.x+200,r.position.y+200}})end)script.on_event(defines.events.on_player_respawned,function(m)local r=game.players[m.player_index]drawPlayerList()r.insert{name="pistol",count=1}r.insert{name="firearm-magazine",count=10}end)script.on_event(defines.events.on_player_joined_game,function(m)local r=game.players[m.player_index]r.print({"","Welcome"})if r.gui.left.PlayerList~=nil then r.gui.left.PlayerList.destroy()end;if r.gui.center.README~=nil then r.gui.center.README.destroy()end;if r.gui.top.PlayerList~=nil then r.gui.top.PlayerList.destroy()end;drawPlayerList()drawToolbar()local H=encode(game.players,"players",{"name","admin","online_time","connected","index"})game.write_file("players.json",H,false)if not r.admin and ticktominutes(r.online_time)<1 then drawFrame(r,'Readme','Rules')end end)script.on_event(defines.events.on_player_left_game,function(m)local r=game.players[m.player_index]drawPlayerList()end)script.on_event(defines.events.on_gui_click,function(m)local r=game.players[m.player_index]for d,I in pairs(guis.buttons)do if I[1]==m.element.name then if I[2]then I[2](r,m.element)else game.print('Invaid Button'..I[1])end;break end end end)script.on_event(defines.events.on_gui_text_changed,function(m)local r=game.players[m.player_index]if m.element.parent.parent.filterTable then local s=m.element;local J={}local K=false;if s.pareLine truncated
|
||||
itemRotated={}entityRemoved={}entityCache={}guis={frames={},buttons={}}warningAllowed=nil;timeForRegular=180;CHUNK_SIZE=32;local function a(b,c)if b.find_entities_filtered{area=c,type="decorative"}then for d,e in pairs(b.find_entities_filtered{area=c,type="decorative"})do if e.name~="red-bottleneck"and e.name~="yellow-bottleneck"and e.name~="green-bottleneck"then e.destroy()end end end end;local function f(b,g,h,i,j)a(b,{{g,h},{g+i,h+j}})end;local function k()local b=game.surfaces["nauvis"]for l in b.get_chunks()do f(b,l.x*CHUNK_SIZE,l.y*CHUNK_SIZE,CHUNK_SIZE-1,CHUNK_SIZE-1)end;callAdmin("Decoratives have been removed")end;script.on_event(defines.events.on_chunk_generated,function(m)a(m.surface,m.area)end)function ticktohour(n)local o=tostring(math.floor(n*1/(60*game.speed)/3600))return o end;function ticktominutes(n)local p=math.floor(n*1/(60*game.speed)/60)return p end;function callAdmin(q)for d,r in pairs(game.connected_players)do if r.admin then r.print(q)end end end;function autoMessage()game.print('There are '..#game.connected_players..' players online')game.print('This map has been on for '..ticktohour(game.tick)..' Hours and '..ticktominutes(game.tick)-60*ticktohour(game.tick)..' Minutes')game.print('Please join us on:')game.print('Discord: https://discord.gg/RPCxzgt')game.print('Forum: explosivegaming.nl')game.print('Steam: http://steamcommunity.com/groups/tntexplosivegaming')game.print('To see these links again goto: Readme > Server Info')end;function addFrame(s)guis.frames[s]={}addButton('close',function(r,t)t.parent.parent.parent.destroy()end)end;function addTab(s,u,v,w)guis.frames[s][u]={u,v,w}addButton(u,function(r,t)openTab(r,t.parent.parent.parent.name,t.parent.parent.parent.tab,t.name)end)end;function addButton(x,y)guis.buttons[x]={x,y}end;function drawButton(s,x,z,v)s.add{name=x,type="button",caption=z,tooltip=v}end;function openTab(r,A,B,u)local C=r.gui.center[A].tabBarScroll.tabBar;for d,D in pairs(guis.frames[A])do if D[1]==u then C[D[1]].style.font_color={r=255,g=255,b=255,a=255}clearElement(B)D[3](r,B)else C[D[1]].style.font_color={r=100,g=100,b=100,a=255}end end end;function drawFrame(r,A,u)if r.gui.center[A]then r.gui.center[A].destroy()end;local s=r.gui.center.add{name=A,type='frame',caption=A,direction='vertical'}local E=s.add{type="scroll-pane",name="tabBarScroll",vertical_scroll_policy="never",horizontal_scroll_policy="always"}local C=E.add{type='flow',direction='horizontal',name='tabBar'}local B=s.add{type="scroll-pane",name="tab",vertical_scroll_policy="auto",horizontal_scroll_policy="never"}for d,D in pairs(guis.frames[A])do drawButton(C,D[1],D[1],D[2])end;openTab(r,A,B,u)drawButton(C,'close','Close','Close this window')B.style.minimal_height=300;B.style.maximal_height=300;B.style.minimal_width=500;B.style.maximal_width=500;E.style.minimal_height=60;E.style.maximal_height=60;E.style.minimal_width=500;E.style.maximal_width=500 end;function toggleVisable(s)if s then if s.style.visible==nil then s.style.visible=false else s.style.visible=not s.style.visible end end end;function clearElement(F)if F~=nil then for G,t in pairs(F.children_names)do F[t].destroy()end end end;script.on_event(defines.events.on_player_created,function(m)local r=game.players[m.player_index]r.insert{name="iron-plate",count=8}r.insert{name="pistol",count=1}r.insert{name="firearm-magazine",count=10}r.insert{name="burner-mining-drill",count=1}r.insert{name="stone-furnace",count=1}r.force.chart(r.surface,{{r.position.x-200,r.position.y-200},{r.position.x+200,r.position.y+200}})end)script.on_event(defines.events.on_player_respawned,function(m)local r=game.players[m.player_index]drawPlayerList()r.insert{name="pistol",count=1}r.insert{name="firearm-magazine",count=10}end)script.on_event(defines.events.on_player_joined_game,function(m)local r=game.players[m.player_index]r.print({"","Welcome"})if r.gui.left.PlayerList~=nil then r.gui.left.PlayerList.destroy()end;if r.gui.center.README~=nil then r.gui.center.README.destroy()end;if r.gui.top.PlayerList~=nil then r.gui.top.PlayerList.destroy()end;drawPlayerList()drawToolbar()local H=encode(game.players,"players",{"name","admin","online_time","connected","index"})game.write_file("players.json",H,false)if not r.admin and ticktominutes(r.online_time)<1 then drawFrame(r,'Readme','Rules')end end)script.on_event(defines.events.on_player_left_game,function(m)local r=game.players[m.player_index]drawPlayerList()end)script.on_event(defines.events.on_gui_click,function(m)local r=game.players[m.player_index]for d,I in pairs(guis.buttons)do if I[1]==m.element.name then if I[2]then I[2](r,m.element)else game.print('Invaid Button'..I[1])end;break end end end)script.on_event(defines.events.on_gui_text_changed,function(m)local r=game.players[m.player_index]if m.element.parent.parent.filterTable then local s=m.element;local J={}local K=false;if s.parent.parent.parent.name=='Admin'then K=true;J[#J+1]='online'end;if s.parent.parent.filterTable.status_input and not K then local L=s.parenLine truncated
|
||||
+2
-5
@@ -149,11 +149,6 @@ 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}
|
||||
--developer items
|
||||
if player.name == "badgamernl" or player.name == "BADgamerNL" then
|
||||
player.insert{name="blueprint", count = 1}
|
||||
player.insert{name="deconstruction-planner", count = 1}
|
||||
end
|
||||
player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}})
|
||||
end)
|
||||
|
||||
@@ -577,6 +572,7 @@ addButton('revive_dead_entitys_range',function(player,frame) if tonumber(frame.p
|
||||
addButton('remove_biters',function(player,frame) for key, entity in pairs(game.surfaces[1].find_entities_filtered({force='enemy'})) do entity.destroy() end end)
|
||||
addButton('tp_all',function(player,frame) for i,p in pairs(game.connected_players) do local pos = game.surfaces[player.surface.name].find_non_colliding_position("player", player.position, 32, 1) if p ~= player then p.teleport(pos) end end end)
|
||||
addButton('toggle_cheat',function(player,frame) player.cheat_mode = not player.cheat_mode end)
|
||||
addButton('add_dev_items',function(player,frame) player.insert{name="deconstruction-planner", count = 1} player.insert{name="blueprint-book", count = 1} player.insert{name="blueprint", count = 20} end)
|
||||
addButton("btn_Modifier_apply",
|
||||
function(player,frame)
|
||||
local forceModifiers = {
|
||||
@@ -610,6 +606,7 @@ addButton("btn_Modifier_apply",
|
||||
addTab('Admin', 'Commands', 'Random useful commands',
|
||||
function(player, frame)
|
||||
drawButton(frame,'btn_toolbar_automessage','Auto Message','Send the auto message to all online players')
|
||||
drawButton(frame,'add_dev_items','Get Blueprints','Get all the blueprints')
|
||||
drawButton(frame,'revive_dead_entitys','Revive All Entitys','Brings all dead machines back to life')
|
||||
drawButton(frame,'revive_dead_entitys_range','Revive Entitys','Brings all dead machines back to life in a range')
|
||||
frame.add{type='textfield',name='range',text='Range'}
|
||||
|
||||
Reference in new issue
Block a user