mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Added unixtime signal to inventory combinator
This commit is contained in:
1 parent
7c1caebccc
commit
a70342fd82
3 files changed
+12
-2
No files matched your search
@@ -287,7 +287,8 @@ setInterval(function () {
|
|||||||
for (i = 0; i < inventory.length; i++) {
|
for (i = 0; i < inventory.length; i++) {
|
||||||
inventoryFrame[inventory[i].name] = Number(inventory[i].count);
|
inventoryFrame[inventory[i].name] = Number(inventory[i].count);
|
||||||
}
|
}
|
||||||
// console.log("RCONing inventory! " + JSON.stringify(inventoryFrame));
|
inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000);
|
||||||
|
console.log("RCONing inventory! " + JSON.stringify(inventoryFrame));
|
||||||
client.exec("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')");
|
client.exec("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -446,7 +446,9 @@ function UpdateInvCombinators()
|
|||||||
local fluids = game.fluid_prototypes
|
local fluids = game.fluid_prototypes
|
||||||
if global.invdata then
|
if global.invdata then
|
||||||
for name,count in pairs(global.invdata) do
|
for name,count in pairs(global.invdata) do
|
||||||
if fluids[name] then
|
if name == "signal-unixtime" then
|
||||||
|
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="virtual"}}
|
||||||
|
elseif fluids[name] then
|
||||||
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="fluid"}}
|
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="fluid"}}
|
||||||
elseif items[name] then
|
elseif items[name] then
|
||||||
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="item"}}
|
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="item"}}
|
||||||
|
|||||||
@@ -175,6 +175,13 @@ data:extend{
|
|||||||
subgroup = "virtual-signal-clusterio",
|
subgroup = "virtual-signal-clusterio",
|
||||||
order = "e[clusterio]-[3localid]"
|
order = "e[clusterio]-[3localid]"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type = "virtual-signal",
|
||||||
|
name = "signal-unixtime",
|
||||||
|
icon = "__base__/graphics/icons/signal/signal_grey.png",
|
||||||
|
subgroup = "virtual-signal-clusterio",
|
||||||
|
order = "e[clusterio]-[4unixtime]"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- TX Combinator
|
-- TX Combinator
|
||||||
|
|||||||
Reference in new issue
Block a user