mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Fixed a few bugs
This commit is contained in:
@@ -10,7 +10,7 @@ Discord: https://discord.gg/r6dC2uK
|
|||||||
|
|
||||||
local function _global(reset)
|
local function _global(reset)
|
||||||
global.addons = not reset and global.addons or {}
|
global.addons = not reset and global.addons or {}
|
||||||
global.addons.rockets = not reset and global.addons.rockets or {first=0,last=0,milestones={m1=0,m2=0,m5=0,m10=0,m20=0,m50=0,m100=0,m200=0,m500=0}}
|
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}}
|
||||||
return global.addons.rockets
|
return global.addons.rockets
|
||||||
end
|
end
|
||||||
Gui.left.add{
|
Gui.left.add{
|
||||||
@@ -23,24 +23,35 @@ Gui.left.add{
|
|||||||
local data = _global()
|
local data = _global()
|
||||||
local satellites = player.force.get_item_launched('satellite')
|
local satellites = player.force.get_item_launched('satellite')
|
||||||
local time = {'rockets.nan'}
|
local time = {'rockets.nan'}
|
||||||
if satellites == 1 then time = tick_to_display_format(game.tick) data.first = game.tick data.last = game.tick
|
if satellites == 1 then time = tick_to_display_format(game.tick)
|
||||||
elseif satellites > 1 then tick_to_display_format((game.tick-data.first)/satellites) data.last = game.tick end
|
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{
|
frame.add{
|
||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.sent',satellites}
|
caption={'rockets.sent',satellites}
|
||||||
}
|
}
|
||||||
frame.add{
|
frame.add{
|
||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.first',tick_to_display_format(data.fist)}
|
caption={'rockets.first',tick_to_display_format(data.first)}
|
||||||
}
|
}
|
||||||
frame.add{
|
frame.add{
|
||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.last',tick_to_display_format(game.tick-data.last)}
|
caption={'rockets.last',tick_to_display_format(data.last-data._last)}
|
||||||
}
|
}
|
||||||
frame.add{
|
frame.add{
|
||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.time',time}
|
caption={'rockets.time',time}
|
||||||
}
|
}
|
||||||
|
frame.add{
|
||||||
|
type='label',
|
||||||
|
caption={'rockets.fastest',tick_to_display_format(data.fastest)}
|
||||||
|
}
|
||||||
frame.add{
|
frame.add{
|
||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.milestones'},
|
caption={'rockets.milestones'},
|
||||||
@@ -63,6 +74,7 @@ Gui.left.add{
|
|||||||
type='label',
|
type='label',
|
||||||
caption={'rockets.format',tostring(milestone),_time}
|
caption={'rockets.format',tostring(milestone),_time}
|
||||||
}
|
}
|
||||||
|
if time == 0 then break end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
can_open=function(player)
|
can_open=function(player)
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ sent=Rockets Sent: __1__
|
|||||||
first=First Lanuched At: __1__
|
first=First Lanuched At: __1__
|
||||||
last=Last Launch Took: __1__
|
last=Last Launch Took: __1__
|
||||||
time=Average Launch Time: __1__
|
time=Average Launch Time: __1__
|
||||||
|
fastest=Fastest Launch: __1__
|
||||||
milestones=Milestones:
|
milestones=Milestones:
|
||||||
format=__1__: __2__
|
format=__1__: __2__
|
||||||
Reference in New Issue
Block a user