Skip to content

Commit 362d16d

Browse files
authored
Merge pull request #2 from Navatusein/dev
Dev
2 parents b0e9cef + f124354 commit 362d16d

File tree

9 files changed

+192
-1
lines changed

9 files changed

+192
-1
lines changed

README.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,191 @@
11
# GTNH-OC-Black-Hole-Control
2+
3+
## Content
4+
5+
- [Information](#information)
6+
- [Installation](#installation)
7+
- [Setup](#setup)
8+
- [Configuration](#configuration)
9+
10+
<a id="information"></a>
11+
12+
## Information
13+
14+
The program is designed to automate Black Hole. The program is able to add Space Time
15+
to keep the stability, also has Save Recipe Mode which will add just the right
16+
amount of spacetime to keep the recipe from being voided.
17+
It is also possible to send messages to Discord about out of service situations.
18+
And there is also the possibility of auto update at startup.
19+
20+
#### Controls
21+
22+
<kbd>Q</kbd> - Closing the program
23+
24+
<kbd>Delete</kbd> - Clear scroll list
25+
26+
<kbd>Arrow Up</kbd> - Scroll list up
27+
28+
<kbd>Arrow Down</kbd> - Scroll list down
29+
30+
#### Interface
31+
32+
![Interface](/docs/interface.png)
33+
34+
<a id="installation"></a>
35+
36+
> [!CAUTION]
37+
> If you are using 8 java, the installer will not work for you.
38+
> The only way to install the program is to manually transfer it to your computer.
39+
> The problem is on the java side.
40+
41+
To install program, you need a computer with:
42+
- Graphics Card (Tier 3): 1
43+
- Central Processing Unit (CPU) (Tier 3): 1
44+
- Memory (Tier 3.5): 2
45+
- Hard Disk Drive (Tier 3) (4MB): 1
46+
- EEPROM (Lua BIOS): 1
47+
- Internet Card: 1
48+
49+
![Computer setup](/docs/computer.png)
50+
51+
Install the basic Open OS on your computer.
52+
Then run the command to start the installer.
53+
54+
```shell
55+
pastebin run ESUAMAGx
56+
```
57+
58+
Then select the Black Hole Control program in the installer.
59+
If you wish you can add the program to auto download, for manual start write a command.
60+
61+
```shell
62+
main
63+
```
64+
65+
> [!NOTE]
66+
> For convenient configuration you can use the web configurator.
67+
> [GTNH-OC-Web-Configurator](https://navatusein.github.io/GTNH-OC-Web-Configurator/#/configurator?url=https%3A%2F%2Fraw.githubusercontent.com%2FNavatusein%2FGTNH-OC-Black-Hole-Control%2Fmain%2Fconfig-descriptor.yml)
68+
69+
<a id="setup"></a>
70+
71+
## Setup
72+
73+
To build a setup, you will need:
74+
75+
- Transposer: 2
76+
- Adapter: 3
77+
- MFU: 2
78+
- Database: 1
79+
80+
You need to make a separate subnet for this set-up further than the black hole subnet (It is red in the diagrams).
81+
It should see Space Time from the main network (It is green in the diagrams), it should also contain
82+
“Fluid Discretizer” and CPU with “Crafting Monitor”. The number of CPUs is
83+
equal to the number of black holes connected to the subnet.
84+
85+
![Black hole subnet setup](/docs/black-hole-subnet.png)
86+
87+
To add a Space Time, you need to make one more mini subnet further than the input subnet
88+
(It is purple on the diagram). The program adds a Space Time by ordering a fake recipe.
89+
This is done because there is no easier way to add a large number of Space Time.
90+
The mini subsystem consists of: “ME Dual Interface”, ‘ME Drive’,
91+
‘Stocking Input Hatch (ME)’. In the “ME Drive” you need to put a fluid cell.
92+
Also in this part there is a transposer and “ME IO Port”. This part is needed to drain
93+
the Space Time residue into the black hole subsystem.
94+
You should also put “Database Upgrade (Tier 3)” in the adapter.
95+
96+
> [!CAUTION]
97+
> To work properly, you need to put any liquid сraft template (which is pink) in the interface.
98+
99+
![Input subnet setup](/docs/input-subnet.png)
100+
101+
To feed the seeds, you must install a trasposer from the interfaces in which the seeds are configured.
102+
The trasposer transfers the seeds to the bus input on which it is installed.
103+
104+
![Seeds trasposer](/docs/seeds-transposer.png)
105+
106+
You must also connect the “Crafting Input Buffer (ME)” or “Crafting Input Bus (ME)” or “Crafting Input Proxy”
107+
to the computer via the MFU. The MFU is placed in the adapter.
108+
109+
![Inputs mfu](/docs/input-mfu.png)
110+
111+
Also, the black hole controller must be connected via MFU to the adapter.
112+
113+
![Controller mfu](/docs/controller-mfu.png)
114+
115+
<a id="configuration"></a>
116+
117+
## Configuration
118+
119+
> [!NOTE]
120+
> For convenient configuration you can use the web configurator.
121+
> [GTNH-OC-Web-Configurator](https://navatusein.github.io/GTNH-OC-Web-Configurator/#/configurator?url=https%3A%2F%2Fraw.githubusercontent.com%2FNavatusein%2FGTNH-OC-Black-Hole-Control%2Fmain%2Fconfig-descriptor.yml)
122+
123+
General configuration in file `config.lua`
124+
125+
Enable auto update when starting the program.
126+
127+
```lua
128+
enableAutoUpdate = true, -- Enable auto update on start
129+
```
130+
131+
In the `timeZone` field you can specify your time zone.
132+
133+
In the `discordWebhookUrl` field, you can specify the Discord Webhook link so that the program sends messages to the discord about emergency situations.
134+
[How to Create a Discord Webhook?](https://www.svix.com/resources/guides/how-to-make-webhook-discord/)
135+
136+
```lua
137+
logger = loggerLib:newFormConfig({
138+
name = "Black Hole Control",
139+
timeZone = 3, -- Your time zone
140+
handlers = {
141+
discordLoggerHandler:newFormConfig({
142+
logLevel = "warning",
143+
messageFormat = "{Time:%d.%m.%Y %H:%M:%S} [{LogLevel}]: {Message}",
144+
discordWebhookUrl = "" -- Discord Webhook URL
145+
}),
146+
fileLoggerHandler:newFormConfig({
147+
logLevel = "info",
148+
messageFormat = "{Time:%d.%m.%Y %H:%M:%S} [{LogLevel}]: {Message}",
149+
filePath = "logs.log"
150+
}),
151+
scrollListLoggerHandler:newFormConfig({
152+
logLevel = "debug",
153+
logsListSize = 32
154+
}),
155+
}
156+
}),
157+
```
158+
159+
In the `blackHoleSeedsTransposerAddress` field you specify address of the transposer witch provide black hole seeds.
160+
161+
In the `blackHoleSeedInputBusSide` field you specify side of the transposer witch connected to seeds input bus.
162+
163+
In the `ioPortTransposerAddress` field you specify address of the transposer witch connected to ME Drive and ME IO Port.
164+
165+
In the `meDriveSide` field you specify side of the transposer witch connected to ME Drive.
166+
167+
In the `meIoPortSide` field you specify side of the transposer witch connected to ME IO Port.
168+
169+
In the `meInterfaceAddress` field you specify address of the me interface witch connected to input subnet.
170+
171+
In the `saveRecipeMode` field you specify enable save recipe mode that will add just the right amount of spacetime to keep the recipe from being voided.
172+
173+
In the `maxCyclesCount` field you specify number of spacetime addition cycles. Each cycle is 30 seconds. Use the calculator to calculate consumption. [Link to calculator](https://www.desmos.com/calculator/yrnt694v3h)
174+
175+
> [!CAUTION]
176+
> For a stable “Superdense Magnetohydrodynamically Constrained Star Matter Plate”
177+
> craft, specify 27 cycles in the `maxCyclesCount` field.
178+
179+
180+
```lua
181+
controller = blackHoleController:newFormConfig({
182+
blackHoleSeedsTransposerAddress = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", -- Address of transposer which provide black hole seeds.
183+
blackHoleSeedInputBusSide = sides.south, -- Side of transposer which connected to seeds input bus.
184+
ioPortTransposerAddress = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", -- Address of transposer which connected to ME Drive and ME IO Port.
185+
meDriveSide = sides.west, -- Side of transposer which connected to ME Drive.
186+
meIoPortSide = sides.east, -- Side of transposer which connected to ME IO Port.
187+
meInterfaceAddress = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", -- Address of ME Interface.
188+
saveRecipeMode = true, -- Recipe save mode.
189+
maxCyclesCount = 0, -- Maximum number of cycles. For calculation use: https://www.desmos.com/calculator/yrnt694v3h
190+
})
191+
```

docs/black-hole-subnet.png

1.75 MB
Loading

docs/computer.png

7.08 KB
Loading

docs/controller-mfu.png

724 KB
Loading

docs/input-mfu.png

1.41 MB
Loading

docs/input-subnet.png

864 KB
Loading

docs/interface.png

6.02 KB
Loading

docs/seeds-transposer.png

744 KB
Loading

src/black-hole-controller.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ function blackHoleController:new(
9393

9494
self.stateMachine.data.spaceTimePerCraftCount = self:calculateSpaceTimeCount(self.maxCyclesCount)
9595

96+
event.push("log_info", "Required Space Time: "..numWithCommas(self.stateMachine.data.spaceTimePerCraftCount));
97+
9698
self.stateMachine.states.idle = self.stateMachine:createState("Idle")
9799
self.stateMachine.states.idle.init = function()
98100
self.stateMachine.data.startTime = nil
@@ -104,7 +106,6 @@ function blackHoleController:new(
104106

105107
if self.saveRecipeMode == true or self.maxCyclesCount ~= 0 then
106108
self:removeExcessSpacetime()
107-
event.push("log_info", "Required Space Time: "..numWithCommas(self.stateMachine.data.spaceTimePerCraftCount));
108109
end
109110
end
110111
self.stateMachine.states.idle.update = function()

0 commit comments

Comments
 (0)