Skip to content

Commit

Permalink
eoh
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Jun 2, 2024
1 parent cae6b14 commit 9995558
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions EOH/v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ local function setState(newState)
return false
end

local ONE_G = 1000000000

local function update()
if not masterSwitch.isOn() then
colorPrint(GREEN, "主控已关闭, 停止控制")
Expand All @@ -250,9 +252,9 @@ local function update()
end

colorPrint(GREEN, "请求转移 " .. tostring(thisTimePush) .. " G, 总共还缺少 " .. tostring(remainingToPush) .. " G")
local success, transferred = inputH.transferFluid(outputSide, thisTimePush * 10000000)
local success, transferred = inputH.transferFluid(outputSide, thisTimePush * ONE_G)
if success then
pushedH = pushedH + transferred / 10000000;
pushedH = pushedH + transferred / ONE_G;
colorPrint(GREEN, "转移氢气: " .. tostring(transferred) .. " G")
else
colorPrint(RED, "转移氢气失败")
Expand All @@ -271,9 +273,9 @@ local function update()
end

colorPrint(GREEN, "请求转移 " .. tostring(thisTimePush) .. " G, 总共还缺少 " .. tostring(remainingToPush) .. " G")
local success, transferred = inputN.transferFluid(outputSide, thisTimePush * 10000000)
local success, transferred = inputN.transferFluid(outputSide, thisTimePush * ONE_G)
if success then
pushedN = pushedN + transferred / 10000000;
pushedN = pushedN + transferred / ONE_G;
colorPrint(GREEN, "转移氮气: " .. tostring(transferred) .. " G")
else
colorPrint(RED, "转移氮气失败")
Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ rm v1.lua && wget http://e404.top:1111/EOH/v1.lua && ./v1.lua 40 18010
```

```shell
rm v2.lua && wget http://e404.top:1111/EOH/v2.lua && ./v2.lua 800 800 18010
rm v2.lua && wget http://e404.top:1111/EOH/v2.lua && ./v2.lua 8 8 18010
```

0 comments on commit 9995558

Please sign in to comment.