mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 21:01:39 +09:00
Added ExpGamingInfo
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
--- Adds a system to manage and auto-create permission groups.
|
--- Adds a system to manage and auto-create permission groups.
|
||||||
-- @module ExpGamingCore@Group
|
-- @module ExpGamingCore@Group
|
||||||
-- @author Cooldude2606
|
-- @author Cooldude2606
|
||||||
-- @license Discord: Cooldude2606@5241
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
-- @alais Group
|
-- @alais Group
|
||||||
|
|
||||||
-- Module Require
|
-- Module Require
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--- Adds roles where a player can have more than one role
|
--- Adds roles where a player can have more than one role
|
||||||
-- @module ExpGamingCore.Role@4.0.0
|
-- @module ExpGamingCore.Role@4.0.0
|
||||||
-- @author Cooldude2606
|
-- @author Cooldude2606
|
||||||
-- @license https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Role_4.0.0.zip
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
-- @alais Role
|
-- @alais Role
|
||||||
|
|
||||||
-- Module Require
|
-- Module Require
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
--[[
|
--- Adds a readme gui to the game that contains useful information
|
||||||
Explosive Gaming
|
-- @module ExpGamingInfo.Readme
|
||||||
|
-- @author Cooldude2606
|
||||||
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
|
-- @alais ThisModule
|
||||||
|
|
||||||
This file can be used with permission but this and the credit below must remain in the file.
|
-- Module Require
|
||||||
Contact a member of management on our discord to seek permission to use our code.
|
local Gui = require('ExpGamingCore.Gui@^4.0.0')
|
||||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
local Game = require('FactoiorStdLib.Game@^0.8.0')
|
||||||
Discord: https://discord.gg/r6dC2uK
|
|
||||||
]]
|
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
|
||||||
|
|
||||||
|
-- Module Define
|
||||||
|
local module_verbose = false
|
||||||
|
local ThisModule = {
|
||||||
|
on_init=function()
|
||||||
|
if loaded_modules['ExpGamingCore.Sync^4.0.0'] then require(module_path..'/src/sync',{Gui=Gui}) end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Function Define
|
||||||
local function format_label(label)
|
local function format_label(label)
|
||||||
label.style.maximal_width = 480
|
label.style.maximal_width = 480
|
||||||
label.style.single_line = false
|
label.style.single_line = false
|
||||||
@@ -119,14 +128,5 @@ end):add_tab('rules',{'readme.rules-name'},{'readme.rules-tooltip'},function(fra
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-guildlines','View Guildlines','View the guildlines in the readme',function(player,element)
|
-- Module Return
|
||||||
Gui.center.open_tab(player,'readme','guildlines')
|
return ThisModule
|
||||||
end))
|
|
||||||
|
|
||||||
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-links','View Other Links','View the links in the readme',function(player,element)
|
|
||||||
Gui.center.open_tab(player,'readme','links')
|
|
||||||
end))
|
|
||||||
|
|
||||||
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-rules','View All Rules','View the all rules in the readme',function(player,element)
|
|
||||||
Gui.center.open_tab(player,'readme','rules')
|
|
||||||
end))
|
|
||||||
22
modules/ExpGamingInfo/Readme/softmod.json
Normal file
22
modules/ExpGamingInfo/Readme/softmod.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "Readme",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a readme gui to the game that contains useful information",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Readme",
|
||||||
|
"New Player"
|
||||||
|
],
|
||||||
|
"author": "<blank>",
|
||||||
|
"contact": "<blank>",
|
||||||
|
"license": "<blank>",
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
14
modules/ExpGamingInfo/Readme/src/sync.lua
Normal file
14
modules/ExpGamingInfo/Readme/src/sync.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
local Sync = require('ExpGamingCore.Sync@^4.0.0')
|
||||||
|
local Gui = Gui
|
||||||
|
|
||||||
|
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-guildlines','View Guildlines','View the guildlines in the readme',function(player,element)
|
||||||
|
Gui.center.open_tab(player,'readme','guildlines')
|
||||||
|
end))
|
||||||
|
|
||||||
|
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-links','View Other Links','View the links in the readme',function(player,element)
|
||||||
|
Gui.center.open_tab(player,'readme','links')
|
||||||
|
end))
|
||||||
|
|
||||||
|
Sync.add_to_gui(Gui.inputs.add_button('readme-sync-rules','View All Rules','View the all rules in the readme',function(player,element)
|
||||||
|
Gui.center.open_tab(player,'readme','rules')
|
||||||
|
end))
|
||||||
103
modules/ExpGamingInfo/Rockets/control.lua
Normal file
103
modules/ExpGamingInfo/Rockets/control.lua
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
--- Adds a rocket count gui to the game that shows milestones and average rocket time
|
||||||
|
-- @module ExpGamingInfo.Rockets
|
||||||
|
-- @author Cooldude2606
|
||||||
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
|
-- @alais ThisModule
|
||||||
|
|
||||||
|
-- Module Require
|
||||||
|
local Gui = require('ExpGamingCore.Gui@^4.0.0')
|
||||||
|
local Game = require('FactoiorStdLib.Game@^0.8.0')
|
||||||
|
|
||||||
|
-- Module Define
|
||||||
|
local module_verbose = false
|
||||||
|
local ThisModule = {
|
||||||
|
on_init=function()
|
||||||
|
if loaded_modules['ExpGamingCore.Sync^4.0.0'] then require(module_path..'/src/sync') end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Global Define
|
||||||
|
local global = global{
|
||||||
|
update=0,
|
||||||
|
first=0,
|
||||||
|
_last=0,
|
||||||
|
last=0,
|
||||||
|
fastest=0,
|
||||||
|
milestones={m1=0,m2=0,m5=0,m10=0,m20=0,m50=0,m100=0,m200=0,m500=0,m1000=0,m2000=0,m5000=0}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Function Define
|
||||||
|
Gui.left.add{
|
||||||
|
name='rockets',
|
||||||
|
caption='item/rocket-silo',
|
||||||
|
tooltip={'rockets.tooltip'},
|
||||||
|
draw=function(frame)
|
||||||
|
frame.caption = {'rockets.name'}
|
||||||
|
local player = Game.get_player(frame.player_index)
|
||||||
|
local satellites = player.force.get_item_launched('satellite')
|
||||||
|
local time = {'rockets.nan'}
|
||||||
|
if satellites == 1 then time = tick_to_display_format(game.tick)
|
||||||
|
elseif satellites > 1 then time = tick_to_display_format((game.tick-global.first)/satellites) end
|
||||||
|
if satellites ~= global.update then
|
||||||
|
global.update = satellites
|
||||||
|
if global.first == 0 then global.first = game.tick end
|
||||||
|
global._last = global.last
|
||||||
|
global.last = game.tick
|
||||||
|
if global.last-global._last < global.fastest or global.fastest == 0 then global.fastest = global.last-global._last end
|
||||||
|
end
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.sent',satellites}
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.first',tick_to_display_format(global.first)}
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.last',tick_to_display_format(global.last-global._last)}
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.time',time}
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.fastest',tick_to_display_format(global.fastest)}
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.milestones'},
|
||||||
|
style='caption_label'
|
||||||
|
}
|
||||||
|
local milestones = frame.add{
|
||||||
|
type='flow',
|
||||||
|
direction='vertical'
|
||||||
|
}
|
||||||
|
for milestone,time in pairs(global.milestones) do
|
||||||
|
local milestone = tonumber(milestone:match('%d+'))
|
||||||
|
if time == 0 and satellites == milestone then
|
||||||
|
global.milestones['m'..milestone] = global.last
|
||||||
|
time = global.last
|
||||||
|
Gui.left.open('rockets')
|
||||||
|
end
|
||||||
|
local _time = {'rockets.nan'}
|
||||||
|
if time > 0 then _time = tick_to_display_format(time) end
|
||||||
|
milestones.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.format',tostring(milestone),_time}
|
||||||
|
}
|
||||||
|
if time == 0 then break end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
can_open=function(player)
|
||||||
|
if player.force.get_item_launched('satellite') > 0 then return true
|
||||||
|
else return {'rockets.none'} end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Event Define
|
||||||
|
script.on_event(defines.events.on_rocket_launched,function(event) Gui.left.update('rockets') end)
|
||||||
|
|
||||||
|
-- Module Return
|
||||||
|
return ThisModule
|
||||||
21
modules/ExpGamingInfo/Rockets/softmod.json
Normal file
21
modules/ExpGamingInfo/Rockets/softmod.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "Rockets",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a rocket count gui to the game that shows milestones and average rocket time",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Rockets"
|
||||||
|
],
|
||||||
|
"author": "<blank>",
|
||||||
|
"contact": "<blank>",
|
||||||
|
"license": "<blank>",
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
20
modules/ExpGamingInfo/Rockets/src/sync.lua
Normal file
20
modules/ExpGamingInfo/Rockets/src/sync.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
local Sync = require('ExpGamingCore.Sync@^4.0.0')
|
||||||
|
local global = global['ExpGamingInfo.Rockets@^4.0.0']
|
||||||
|
|
||||||
|
Sync.add_update('rockets',function()
|
||||||
|
local _return = {}
|
||||||
|
local satellites = game.forces.player.get_item_launched('satellite')
|
||||||
|
local time = {'rockets.nan'}
|
||||||
|
if satellites == 1 then time = tick_to_display_format(game.tick)
|
||||||
|
elseif satellites > 1 then time = tick_to_display_format((game.tick-global.first)/satellites) end
|
||||||
|
_return.total = satellites
|
||||||
|
_return.first = Sync.tick_format(global.first)
|
||||||
|
_return.last = Sync.tick_format(global.last-global._last)
|
||||||
|
_return.time = Sync.tick_format(time)
|
||||||
|
_return.fastest = Sync.tick_format(global.fastest)
|
||||||
|
_return.milestones = {}
|
||||||
|
for milestone,time in pairs(global.milestones) do
|
||||||
|
_return.milestones[milestone] = Sync.tick_format(time)
|
||||||
|
end
|
||||||
|
return _return
|
||||||
|
end)
|
||||||
103
modules/ExpGamingInfo/Science/control.lua
Normal file
103
modules/ExpGamingInfo/Science/control.lua
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
--- Adds a science count gui to the game that shows toatal made and per minute
|
||||||
|
-- @module ExpGamingInfo.Science
|
||||||
|
-- @author Cooldude2606
|
||||||
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
|
-- @alais ThisModule
|
||||||
|
|
||||||
|
-- Module Require
|
||||||
|
local Gui = require('ExpGamingCore.Gui@^4.0.0')
|
||||||
|
local Game = require('FactoiorStdLib.Game@^0.8.0')
|
||||||
|
|
||||||
|
-- Local Varibles
|
||||||
|
local science_packs = {
|
||||||
|
'science-pack-1',
|
||||||
|
'science-pack-2',
|
||||||
|
'science-pack-3',
|
||||||
|
'military-science-pack',
|
||||||
|
'production-science-pack',
|
||||||
|
'high-tech-science-pack',
|
||||||
|
'space-science-pack'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Module Define
|
||||||
|
local module_verbose = false
|
||||||
|
local ThisModule = {
|
||||||
|
on_init=function()
|
||||||
|
if loaded_modules['ExpGamingCore.Sync^4.0.0'] then require(module_path..'/src/sync') end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Global Define
|
||||||
|
local global = global{
|
||||||
|
_base={
|
||||||
|
update=0,
|
||||||
|
_update=0,
|
||||||
|
made={0,0,0,0,0,0,0},
|
||||||
|
_made={0,0,0,0,0,0,0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Function Define
|
||||||
|
Gui.left.add{
|
||||||
|
name='science',
|
||||||
|
caption='item/lab',
|
||||||
|
tooltip={'science.tooltip'},
|
||||||
|
draw=function(frame)
|
||||||
|
local player = Game.get_player(frame.player_index)
|
||||||
|
if not global[player.force.name] then
|
||||||
|
global[player.force.name] = table.deepcopy(global._base)
|
||||||
|
end
|
||||||
|
global = global[player.force.name]
|
||||||
|
frame.caption = {'science.name'}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'science.total'},
|
||||||
|
style='caption_label'
|
||||||
|
}
|
||||||
|
local totals = frame.add{
|
||||||
|
type='flow',
|
||||||
|
direction='vertical'
|
||||||
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'science.time'},
|
||||||
|
style='caption_label'
|
||||||
|
}
|
||||||
|
local times = frame.add{
|
||||||
|
type='flow',
|
||||||
|
direction='vertical'
|
||||||
|
}
|
||||||
|
if global.update < game.tick-100 then
|
||||||
|
global._update = global.update
|
||||||
|
global._made = table.deepcopy(global.made)
|
||||||
|
for i,name in pairs(science_packs) do
|
||||||
|
global.made[i] = player.force.item_production_statistics.get_input_count(name)
|
||||||
|
end
|
||||||
|
global.update = game.tick
|
||||||
|
end
|
||||||
|
for i,name in pairs(science_packs) do
|
||||||
|
local made = global.made[i]
|
||||||
|
if made > 0 then
|
||||||
|
totals.add{
|
||||||
|
type='label',
|
||||||
|
caption={'science.format',{'science.'..name},made}
|
||||||
|
}
|
||||||
|
local _made = string.format('%.2f',(made-global._made[i])/((global.update-global._update)/(3600*game.speed)))
|
||||||
|
times.add{
|
||||||
|
type='label',
|
||||||
|
caption={'science.format',{'science.'..name},_made}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
can_open=function(player)
|
||||||
|
if player.force.item_production_statistics.get_input_count('science-pack-1') > 0 then return true
|
||||||
|
else return {'science.none'} end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Event Define
|
||||||
|
script.on_event(defines.events.on_research_finished,function(event) Gui.left.update('science') end)
|
||||||
|
|
||||||
|
-- Module Return
|
||||||
|
return ThisModule
|
||||||
22
modules/ExpGamingInfo/Science/softmod.json
Normal file
22
modules/ExpGamingInfo/Science/softmod.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "Science",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a science count gui to the game that shows toatal made and per minute",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Science",
|
||||||
|
"Production"
|
||||||
|
],
|
||||||
|
"author": "<blank>",
|
||||||
|
"contact": "<blank>",
|
||||||
|
"license": "<blank>",
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
18
modules/ExpGamingInfo/Science/src/sync.lua
Normal file
18
modules/ExpGamingInfo/Science/src/sync.lua
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
local Sync = require('ExpGamingCore.Sync@^4.0.0')
|
||||||
|
local data = global['ExpGamingInfo.Science@^4.0.0']
|
||||||
|
|
||||||
|
Sync.add_update('science',function()
|
||||||
|
local _return = {}
|
||||||
|
for force_name,global in pairs(data) do
|
||||||
|
if force_name ~= '_base' then
|
||||||
|
_return[force_name] = {totals={},times={}}
|
||||||
|
for i,name in pairs(science_packs) do
|
||||||
|
local made = global.made[i]
|
||||||
|
_return[force_name].totals[name] = made
|
||||||
|
local _made = string.format('%.2f',(made-global._made[i])/((global.update-global._update)/(3600*game.speed)))
|
||||||
|
_return[force_name].times[name] = _made
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return _return
|
||||||
|
end)
|
||||||
@@ -1,26 +1,36 @@
|
|||||||
--[[
|
--- Adds a task list gui which acts like a bulletin board for the current tasks
|
||||||
Explosive Gaming
|
-- @module ExpGamingInfo.Tasklist
|
||||||
|
-- @author Cooldude2606
|
||||||
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
|
-- @alais ThisModule
|
||||||
|
|
||||||
This file can be used with permission but this and the credit below must remain in the file.
|
-- Module Require
|
||||||
Contact a member of management on our discord to seek permission to use our code.
|
local Gui = require('ExpGamingCore.Role@^4.0.0')
|
||||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
local Game = require('FactoiorStdLib.Game@^0.8.0')
|
||||||
Discord: https://discord.gg/r6dC2uK
|
|
||||||
]]
|
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
|
||||||
|
|
||||||
local function _global(reset)
|
-- Module Define
|
||||||
global.addons = not reset and global.addons or {}
|
local module_verbose = false
|
||||||
global.addons.tasklist = not reset and global.addons.tasklist or {tasks={},_edit={},_base={_edit=false,_tasks={},_editing={}}}
|
local ThisModule = {}
|
||||||
return global.addons.tasklist
|
|
||||||
end
|
|
||||||
|
|
||||||
|
-- Global Define
|
||||||
|
local global = global{
|
||||||
|
tasks={},
|
||||||
|
_edit={},
|
||||||
|
_base={
|
||||||
|
_edit=false,
|
||||||
|
_tasks={},
|
||||||
|
_editing={}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Function Define
|
||||||
local edit = Gui.inputs.add{
|
local edit = Gui.inputs.add{
|
||||||
name='tasklist-edit',
|
name='tasklist-edit',
|
||||||
type='button',
|
type='button',
|
||||||
caption='utility/rename_icon_normal'
|
caption='utility/rename_icon_normal'
|
||||||
}:on_event('click',function(event)
|
}:on_event('click',function(event)
|
||||||
local text_flow = event.element.parent.parent.text_flow
|
local text_flow = event.element.parent.parent.text_flow
|
||||||
local data = _global()._edit[event.player_index]
|
local data = global._edit[event.player_index]
|
||||||
if not data._edit then data._tasks = table.deepcopy(_global().tasks) end
|
if not data._edit then data._tasks = table.deepcopy(_global().tasks) end
|
||||||
if text_flow.input.type == 'label' then
|
if text_flow.input.type == 'label' then
|
||||||
data._editing[tonumber(text_flow.parent.name)]=true
|
data._editing[tonumber(text_flow.parent.name)]=true
|
||||||
@@ -38,7 +48,7 @@ local function _edit(frame)
|
|||||||
element.style.height = 20
|
element.style.height = 20
|
||||||
element.style.width = 20
|
element.style.width = 20
|
||||||
local text_flow = element.parent.parent.text_flow
|
local text_flow = element.parent.parent.text_flow
|
||||||
local data = _global()._edit[frame.player_index]
|
local data = global._edit[frame.player_index]
|
||||||
data._tasks[text_flow.parent.name]=text
|
data._tasks[text_flow.parent.name]=text
|
||||||
if data._editing[tonumber(text_flow.parent.name)] then
|
if data._editing[tonumber(text_flow.parent.name)] then
|
||||||
element.style.height = 30
|
element.style.height = 30
|
||||||
@@ -190,3 +200,5 @@ Gui.left.add{
|
|||||||
end,
|
end,
|
||||||
open_on_join=true
|
open_on_join=true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ThisModule
|
||||||
20
modules/ExpGamingInfo/Tasklist/softmod.json
Normal file
20
modules/ExpGamingInfo/Tasklist/softmod.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "Tasklist",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a task list gui which acts like a bulletin board for the current tasks",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Tasks"
|
||||||
|
],
|
||||||
|
"author": "<blank>",
|
||||||
|
"contact": "<blank>",
|
||||||
|
"license": "<blank>",
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
91
modules/ExpGamingInfo/softmod.json
Normal file
91
modules/ExpGamingInfo/softmod.json
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"name": "ExpGamingInfo",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Collection",
|
||||||
|
"description": "Adds info guis to the game for different production areas",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Production"
|
||||||
|
],
|
||||||
|
"author": "Cooldude2606",
|
||||||
|
"contact": "Discord: Cooldude2606@5241",
|
||||||
|
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
|
||||||
|
"submodules": {
|
||||||
|
"Readme": {
|
||||||
|
"name": "Readme",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a readme gui to the game that contains useful information",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Readme",
|
||||||
|
"New Player"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Rockets": {
|
||||||
|
"name": "Rockets",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a rocket count gui to the game that shows milestones and average rocket time",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Rockets"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Science": {
|
||||||
|
"name": "Science",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a science count gui to the game that shows toatal made and per minute",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Science",
|
||||||
|
"Production"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0",
|
||||||
|
"ExpGamingCore.Sync": "?^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Tasklist": {
|
||||||
|
"name": "Tasklist",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Submodule",
|
||||||
|
"description": "Adds a task list gui which acts like a bulletin board for the current tasks",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Gui",
|
||||||
|
"Info",
|
||||||
|
"ExpGaming",
|
||||||
|
"Tasks"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Gui": "^4.0.0",
|
||||||
|
"FactoiorStdLib.Game": "^0.8.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
--[[
|
|
||||||
Explosive Gaming
|
|
||||||
|
|
||||||
This file can be used with permission but this and the credit below must remain in the file.
|
|
||||||
Contact a member of management on our discord to seek permission to use our code.
|
|
||||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
|
||||||
Discord: https://discord.gg/r6dC2uK
|
|
||||||
]]
|
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
|
||||||
|
|
||||||
local function _global(reset)
|
|
||||||
global.addons = not reset and global.addons or {}
|
|
||||||
global.addons.rockets = not reset and global.addons.rockets or {update=0,first=0,_last=0,last=0,fastest=0,milestones={m1=0,m2=0,m5=0,m10=0,m20=0,m50=0,m100=0,m200=0,m500=0,m1000=0,m2000=0,m5000=0}}
|
|
||||||
return global.addons.rockets
|
|
||||||
end
|
|
||||||
Gui.left.add{
|
|
||||||
name='rockets',
|
|
||||||
caption='item/rocket-silo',
|
|
||||||
tooltip={'rockets.tooltip'},
|
|
||||||
draw=function(frame)
|
|
||||||
frame.caption = {'rockets.name'}
|
|
||||||
local player = Game.get_player(frame.player_index)
|
|
||||||
local data = _global()
|
|
||||||
local satellites = player.force.get_item_launched('satellite')
|
|
||||||
local time = {'rockets.nan'}
|
|
||||||
if satellites == 1 then time = tick_to_display_format(game.tick)
|
|
||||||
elseif satellites > 1 then time = tick_to_display_format((game.tick-data.first)/satellites) end
|
|
||||||
if satellites ~= data.update then
|
|
||||||
data.update = satellites
|
|
||||||
if data.first == 0 then data.first = game.tick end
|
|
||||||
data._last = data.last
|
|
||||||
data.last = game.tick
|
|
||||||
if data.last-data._last < data.fastest or data.fastest == 0 then data.fastest = data.last-data._last end
|
|
||||||
end
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.sent',satellites}
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.first',tick_to_display_format(data.first)}
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.last',tick_to_display_format(data.last-data._last)}
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.time',time}
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.fastest',tick_to_display_format(data.fastest)}
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.milestones'},
|
|
||||||
style='caption_label'
|
|
||||||
}
|
|
||||||
local milestones = frame.add{
|
|
||||||
type='flow',
|
|
||||||
direction='vertical'
|
|
||||||
}
|
|
||||||
for milestone,time in pairs(data.milestones) do
|
|
||||||
local milestone = tonumber(milestone:match('%d+'))
|
|
||||||
if time == 0 and satellites == milestone then
|
|
||||||
data.milestones['m'..milestone] = data.last
|
|
||||||
time = data.last
|
|
||||||
Gui.left.open('rockets')
|
|
||||||
end
|
|
||||||
local _time = {'rockets.nan'}
|
|
||||||
if time > 0 then _time = tick_to_display_format(time) end
|
|
||||||
milestones.add{
|
|
||||||
type='label',
|
|
||||||
caption={'rockets.format',tostring(milestone),_time}
|
|
||||||
}
|
|
||||||
if time == 0 then break end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
can_open=function(player)
|
|
||||||
if player.force.get_item_launched('satellite') > 0 then return true
|
|
||||||
else return {'rockets.none'} end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
Event.register(defines.events.on_rocket_launched,function(event) Gui.left.update('rockets') end)
|
|
||||||
Sync.add_update('rockets',function()
|
|
||||||
local _return = {}
|
|
||||||
local data = _global()
|
|
||||||
local satellites = game.forces.player.get_item_launched('satellite')
|
|
||||||
local time = {'rockets.nan'}
|
|
||||||
if satellites == 1 then time = tick_to_display_format(game.tick)
|
|
||||||
elseif satellites > 1 then time = tick_to_display_format((game.tick-data.first)/satellites) end
|
|
||||||
_return.total = satellites
|
|
||||||
_return.first = Sync.tick_format(data.first)
|
|
||||||
_return.last = Sync.tick_format(data.last-data._last)
|
|
||||||
_return.time = Sync.tick_format(time)
|
|
||||||
_return.fastest = Sync.tick_format(data.fastest)
|
|
||||||
_return.milestones = {}
|
|
||||||
for milestone,time in pairs(data.milestones) do
|
|
||||||
_return.milestones[milestone] = Sync.tick_format(time)
|
|
||||||
end
|
|
||||||
return _return
|
|
||||||
end)
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
--[[
|
|
||||||
Explosive Gaming
|
|
||||||
|
|
||||||
This file can be used with permission but this and the credit below must remain in the file.
|
|
||||||
Contact a member of management on our discord to seek permission to use our code.
|
|
||||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
|
||||||
Discord: https://discord.gg/r6dC2uK
|
|
||||||
]]
|
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
|
||||||
|
|
||||||
local science_packs = {
|
|
||||||
'science-pack-1',
|
|
||||||
'science-pack-2',
|
|
||||||
'science-pack-3',
|
|
||||||
'military-science-pack',
|
|
||||||
'production-science-pack',
|
|
||||||
'high-tech-science-pack',
|
|
||||||
'space-science-pack'
|
|
||||||
}
|
|
||||||
|
|
||||||
local function _global(reset)
|
|
||||||
global.addons = not reset and global.addons or {}
|
|
||||||
global.addons.science = not reset and global.addons.science or {_base={update=0,_update=0,made={0,0,0,0,0,0,0},_made={0,0,0,0,0,0,0}}}
|
|
||||||
return global.addons.science
|
|
||||||
end
|
|
||||||
|
|
||||||
Gui.left.add{
|
|
||||||
name='science',
|
|
||||||
caption='item/lab',
|
|
||||||
tooltip={'science.tooltip'},
|
|
||||||
draw=function(frame)
|
|
||||||
local data = _global()
|
|
||||||
local player = Game.get_player(frame.player_index)
|
|
||||||
if not data[player.force.name] then
|
|
||||||
data[player.force.name] = table.deepcopy(data._base)
|
|
||||||
end
|
|
||||||
data = data[player.force.name]
|
|
||||||
frame.caption = {'science.name'}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'science.total'},
|
|
||||||
style='caption_label'
|
|
||||||
}
|
|
||||||
local totals = frame.add{
|
|
||||||
type='flow',
|
|
||||||
direction='vertical'
|
|
||||||
}
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption={'science.time'},
|
|
||||||
style='caption_label'
|
|
||||||
}
|
|
||||||
local times = frame.add{
|
|
||||||
type='flow',
|
|
||||||
direction='vertical'
|
|
||||||
}
|
|
||||||
if data.update < game.tick-100 then
|
|
||||||
data._update = data.update
|
|
||||||
data._made = table.deepcopy(data.made)
|
|
||||||
for i,name in pairs(science_packs) do
|
|
||||||
data.made[i] = player.force.item_production_statistics.get_input_count(name)
|
|
||||||
end
|
|
||||||
data.update = game.tick
|
|
||||||
end
|
|
||||||
for i,name in pairs(science_packs) do
|
|
||||||
local made = data.made[i]
|
|
||||||
if made > 0 then
|
|
||||||
totals.add{
|
|
||||||
type='label',
|
|
||||||
caption={'science.format',{'science.'..name},made}
|
|
||||||
}
|
|
||||||
local _made = string.format('%.2f',(made-data._made[i])/((data.update-data._update)/(3600*game.speed)))
|
|
||||||
times.add{
|
|
||||||
type='label',
|
|
||||||
caption={'science.format',{'science.'..name},_made}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
can_open=function(player)
|
|
||||||
if player.force.item_production_statistics.get_input_count('science-pack-1') > 0 then return true
|
|
||||||
else return {'science.none'} end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
Event.register(defines.events.on_research_finished,function(event) Gui.left.update('science') end)
|
|
||||||
Sync.add_update('science',function()
|
|
||||||
local _return = {}
|
|
||||||
local _data = _global()
|
|
||||||
for force_name,data in pairs(_data) do
|
|
||||||
if force_name ~= '_base' then
|
|
||||||
_return[force_name] = {totals={},times={}}
|
|
||||||
for i,name in pairs(science_packs) do
|
|
||||||
local made = data.made[i]
|
|
||||||
_return[force_name].totals[name] = made
|
|
||||||
local _made = string.format('%.2f',(made-data._made[i])/((data.update-data._update)/(3600*game.speed)))
|
|
||||||
_return[force_name].times[name] = _made
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return _return
|
|
||||||
end)
|
|
||||||
@@ -49,5 +49,9 @@ return {
|
|||||||
['ExpGamingAdmin.Commands@4.0.0']='./modules/ExpGamingAdmin/Commands',
|
['ExpGamingAdmin.Commands@4.0.0']='./modules/ExpGamingAdmin/Commands',
|
||||||
['ExpGamingAdmin.Ban@4.0.0']='./modules/ExpGamingAdmin/Ban',
|
['ExpGamingAdmin.Ban@4.0.0']='./modules/ExpGamingAdmin/Ban',
|
||||||
['ChatPopup@4.0.0']='./modules/ChatPopup',
|
['ChatPopup@4.0.0']='./modules/ChatPopup',
|
||||||
['DamagePopup@4.0.0']='./modules/DamagePopup'
|
['DamagePopup@4.0.0']='./modules/DamagePopup',
|
||||||
|
['ExpGamingInfo.Readme@4.0.0']='./modules/DamagePopup',
|
||||||
|
['ExpGamingInfo.Rockets@4.0.0']='./modules/DamagePopup',
|
||||||
|
['ExpGamingInfo.Science@4.0.0']='./modules/DamagePopup',
|
||||||
|
['ExpGamingInfo.Tasklist@4.0.0']='./modules/DamagePopup',
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user