Space Engineers

Space Engineers

评价数不足
Refinery Management
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
852.000 B
2015 年 10 月 7 日 上午 8:43
2015 年 10 月 8 日 上午 3:55
2 项改动说明 ( 查看 )

订阅以下载
Refinery Management

描述
News
For more features look at the Refinery Management Extension Script which also adds Ingot movement.

Description
DETP Presents the Refinery Management System

The management system manages the input inventory of all refinery's on the grid and moves ores so that all refinery's contain the same amount of ore.

In combination with a Timer the script will manage the input inventory of your refinery's and keep them all running until no more ore is left.



Inner Workings

The Script takes a List of all Refinery's on its Grid and saves them together with the current amount of ore
as pairs.

The List gets sorted Descending (sort key is here the amount of ore).

Now the algorithm goes through the list from top and bottom at the same time and pairs these up
(refinery with most amount ore & refinery with least amount of ore).
The difference is produced and the right amount of Ore is send from the fuller refinery to the more empty one,
-> repeat with next pairs (second , second last .... etc) until end is reached.

Example with 2 Refinerys

sorted list
Refinery 1
Refinery 2
900kg
100kg

After algorithm
Refinery 1
Refinery 2
500kg
500kg

Example with 4 Refinerys
sorted list
Refinery 1
Refinery 2
Refinery 3
Refinery 4
900kg
500kg
300kg
100kg

After algorithm
Refinery 1
Refinery 2
Refinery 3
Refinery 4
500kg
400kg
400kg
500kg

At this point you can see that only pairs get evened out, in combination with the timer this problem will negate itself the next time the script gets called.

The Timer can be set to any time, we recommend on Server times from 5 sec upwards (reduce server workload),
but the script works also fine with a 1 second timer.

As base rule it can be noted:
less ore in ('fast') production -> low timer
much ore in production -> high timer

But a 5 second timer is never wrong.
10 条留言
Glytchii 2020 年 12 月 16 日 下午 6:03 
Doesn't work. Splits an entire stack from one refinery to the next but never splits up the stack. 2 out of my 4 refineries are running. No errors thrown from the code.
cherpychicken 2020 年 1 月 17 日 上午 5:59 
does this still need a timer?
Leon 2018 年 12 月 12 日 上午 7:23 
name off Refinerys ?!?! Refinerys1 or Refinerys 1 0r Refinerys ore ?!?!?!!
Lily Evershine 2016 年 9 月 8 日 上午 8:09 
Never mind. Turns out that a shield mod I had downloaded and was using for some inexplicable reason labels the shield generator as a refinery block... So the problem is not the script's fault.
Lily Evershine 2016 年 9 月 8 日 上午 12:42 
I am getting "Inventorys not connected" as well despite the fact that I can drag between any two refineries, I have checked and the refineries and they are connected by convayers. Although I have convayer sorters elsewhere in the system they do not seperate any two refineries. Most but not all of the refineries are linked by being next to each other as well however they are still linked to the convayer network as well.

Thank you for your help.
Cranc[FRS-RD]  [作者] 2016 年 8 月 24 日 上午 6:01 
@drandarith

yes it should work for the arc furnace too, it gets all blocks from type IMyRefinery which the ArcFurnace is part of i think.
Cranc[FRS-RD]  [作者] 2016 年 8 月 24 日 上午 5:34 
@Lighthugger

Hey,

The message means that the inventorys between two targeted refinerys are not connected and if they arent connected you cant split the inventorys.

so make sure that the refinerys are connected in a way that ores can be moved between them.
drandarith 2016 年 8 月 24 日 上午 4:45 
Would this work for Arc Furnace too? I'd like to know. I'm looking for a resource management script that auto designates Arc mats to furnaces instead of refineries. freeing a refinery for other materials
Orion 2016 年 5 月 5 日 上午 7:13 
I have the same message...:steamsad:
CPT Haddock 2016 年 3 月 14 日 下午 1:59 
Excuse my ignorance but I get an error message saying: "Inventorys not connected" Does it mean what I think it does and I have a stray cargo container not connected somewhere or does it mean something else?