View difference between Paste ID: FcZRymGb and 0D54NcPT
SHOW: | | - or go back to the newest paste.
1
Documentation for https://pastebin.com/0D54NcPT
2-
--Rev 20210701 wtp
2+
3-
--Moved extraneous notes and documentation into https://pastebin.com/FcZRymGb
3+
I'm removing the revision notes and superfluous comments from the Draconic Reactor Monitor program, and consolidating those here.
4-
--author: wparish@wparish.com
4+
5
This pastebin will be referenced from the program instead.
6
7-
-- functions (borrowed from knPtJCjb)
7+
New notes added 8-6-2021
8
Recent additions moved the power increase to the correcting section to do micro increases rather than the periodic 10k increases.
9-
-- logging functions
9+
I've noticed at around 90-95% the temp goes up, between 8000-8500 in particular you'll start to lose containment, the
10-
local function getTime()
10+
program should shut down if it gets to 45%, however you can probably milk a little more chaos out of that last 5% if I add another
11
modem and increase the high size flux gate to the injector by maybe 10k when it gets to 48%, should it get to 45 it should
12-
  contentSite = http.get("http://worldtimeapi.org/api/timezone/GMT").readAll()
12+
go ahead and scram.
13-
 
13+
14-
  if string.find(contentSite, "datetime") ~= nil then -- and string.find(contentSite, "localDate") == 3 then
14+
I've gotten the temp up to 8656 confirmed with 2,109.013 RF/t, however I'm manually tweaking the flow to the field.  that will come in 
15-
      content = contentSite
15+
1.3
16-
  else
16+
17-
      content = "00:00:00.00000','utcDate"
17+
For now the notes verbatim are below:
18-
  end
18+
19-
  timePos = string.find(content,"datetime")+22
19+
20-
  time = string.sub(content, timePos, timePos+13)
20+
--Rev 20210630 wtp as prev. rev didn't change anything it was the motivation for today's changes
21-
--    if string.sub(content, timePos, timePos+1) == "PM" then
21+
--so the version will be held at 1.2
22-
--        timePM = tostring(tonumber(string.sub(time,1,2))+12)..string.sub(time,3)
22+
--Add 50 samples of gain/loss for ~100 seconds of historical energy saturation fluctuations
23-
--        return timePM
23+
--Add file io and log functions, logged a few key events (config, increase, scram)
24-
--    else
24+
--Correct time function to work with 24H GMT from new source
25-
  return time
25+
--Contrary to what might be below, the config file values.cfg should now contain only two lines
26-
-- I don't care if the time is 24H
26+
--fluxgate and fluxgate_out, in that order, as whatever value is reported when your modem is connected
27-
--    end
27+
--Note that fluxgate out is NOT the gate to the injector, I don't mess with that one at all.
28-
end
28+
29-
 
29+
-- I'll also add the following annotation:  This program is written for a very specific reactor using
30-
-- numeric functions
30+
-- 8 awakened blocks of fuel.  I haven't tested any other config.  I also expect that the primary energy core
31-
local function round(num, idp)
31+
-- hard wired (connected with cryo ducts) to the reactor will typically be between 50 and 75% full, with
32-
  local mult = 10^(idp or 0)
32+
-- a second T7 that can have energy shunted to it.  I then swap the core out of the secondary T7 energy
33-
  return math.floor(num * mult + 0.5) / multi
33+
-- core using either blood magic teleposers or thaum wand of dislocation
34-
end
34+
-- note do not put the full core in the same cube as the T7 core or it will detect it and be 'invalid'
35
36-
-- file functions
36+
--Rev 20210625 wtp 1.2
37-
-- write table to file 'path'
37+
-- moved to dirtcraft
38-
local function fileWrite(path, text)
38+
--Rev. 20210619 wtp
39-
  local file = io.open(path, "w")
39+
--As my previous paste could be my 'first', this one will become my 1.1 release.
40-
  file:write(text)
40+
41-
  file:close()
41+
--Developed for use on 1.7 Infinity with Draconic Evolution 1.7.10-1.0.2h (Mym.li normal mode)
42-
end
42+
43
--I've got the main parts I wanted, the setup and considerations are detailed below:
44-
-- get table from 'path'
44+
45-
local function fileGetTable(path)
45+
--Advanced computer with a Draconic Reactor stabilizer on it's right side.
46-
  if fs.exists(path) then
46+
--Red cage lamp on top (to come on when either containment field or saturation <51%)
47-
    local file = io.open(path, "r")
47+
-- Note: neither light will light nor flash at 51%, if the last iteration left the red light illuminated it will stay
48-
    local lines = {}
48+
--       illuminated until either it drops below 51% or rises up or beyond 52% (I call this the 'transition period')
49-
    local i = 1
49+
--Green cage lamb on back (to come on with both containment field and saturation >51%)
50-
    local line = file:read("*l")
50+
--A wired modem is on the left side with a cable running up to the Tier-7 Draconic Energy Core Energy Pylon
51-
    while line ~= nil do
51+
--advanced monitors 5 wide, three tall stacked below the computer facing the stabilizer I have the flux gate on.
52-
      lines[i] = line
52+
--The Draconic Reactor is connected directly with cryotheum ducts from the stabilizer to the T7 energy 'input'
53-
      line = file:read("*l")
53+
--then the T7 energy output goes to the reactor injector.
54-
       i = i +1
54+
-- The reactor injector flux gate has a redstone signal high at 262,000RF/t and connects back to the injector in
55-
    end
55+
-- reverse containment field mode (three repeaters and a piece of redstone) using 139,700K for my mostly used reactor
56-
    file:close()
56+
-- The stabilizer flux gate to the T7 energy core is currently set at 2,010,000 though of course that took weeks and starts
57-
    return lines
57+
-- out much lower.
58-
  end
58+
-- Since the T7 fills up and the reactor essentially shuts down, I have a third flux gate 'drain' between the T7 
59-
  return {}
59+
-- energy core and the injector flux gate which is also connected to a modem and wired back to the computer.
60-
end
60+
-- The idea is to allow both my use and public use to draw on the reactor up to the amount the reactor creates,
61
-- but to limit the flux gate if that drain gets too high as I've found connecting a new t7 to any of those tessearcts
62-
-- update line in file 'path' (n is line number)
62+
-- on that flux gate would run out the buffer for the reactor and it would ultimately fail (I lost at least one core this way)
63-
local function fileReplaceLine(path, n, text)
63+
64-
  local lines = fileGetTable(path)
64+
-- Its worth acknowledging that the mym.li servers disable the explosion, so while losing the chaos shards hurts,
65-
  lines[n] = text
65+
-- at least you don't lose the rest of the infrastructure.
66-
  fileWriteFromTable(path, lines)
66+
67-
end
67+
-- Changes for the 19th.
68
-- Mostly cosmetic, I'm going to start by converting my print redirect output to specific monitor coordinates
69-
-- append line of text to path
69+
-- also better color management, so if the saturation is gaining during the transition period I want that green
70-
local function fileAppend(path, text)
70+
-- but the draining warning should be yellow
71-
  local file = io.open(path, "a")
71+
-- the fluxgate flow override when it kicks in should be red
72-
  file:write(text.."\n")
72+
-- the normal flux gate flow set to the generation power-field drain should be green
73-
  file:close()
73+
-- I may also suppress the maxFieldStrength and maxEnergySaturation as it's static and you sort of get that from the 
74-
end
74+
-- current values and their respective percentages
75
-- I'm also going to shuffle around and try to put the variable definitions together in a block rather than 
76-
-- get file length for path
76+
-- having code intermixed in the variable initialization block
77-
local function fileGetLength(path)
77+
78-
  local file = io.open(path, "r")
78+
79-
  local i = 0
79+
80-
  while file:read("*l") ~= nil do
80+
  -- functions (borrowed from knPtJCjb)
81-
    i = i +1
81+