Signal Stop Timer System

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

namiasdf

New Member
Jul 29, 2019
2,183
0
0
I am trying to design a system that sends a redstone pulse/signal, to a toggle switch, when two separate conditions are met.

1. When the tank is full
2. When the tank is empty

By doing this I can successfully purge the system of excess whatever into a separate system. This separate system is one that consumes the resource at an enormously high rate, which is why I only want this to occur when I have an excess of this whatever.

This is a lava EU generating source that my main base uses for its main energy needs. I produce the lava at a greater rate than I consume it. Periodically, I would like the system to automatically purge the excess energy into my UU-Matter generating system. This period is defined at the time when my lava tank is "full", switching off when my lava tank is "empty". I do not need to worry about having no lava, since I have 8 MFSU's dedicated to base operations.

The logic is simple. When tank is full, send a pulse to a toggle latch, turn the MFSU on and allow energy flow. When the tank is empty, send a pulse to the same toggle latch, turn the MFSU off and disable energy flow.

The problem is that I need to add a 5-10min-ish timer delay to the signal generating source. There is a period of time when the tank is full/empty where there will be redundant instances of the conditions which set off the toggle switch. (i.e. it will be full, turn the switch on, then purge a little. The backup from the lava generating system will cause the system to become full again. This will send the pulse once more, causing the toggle to turn from on to off. Vice versa for the empty case.)

As you can see, I will never be able to achieve a full cycle of "full to empty" unless I can add a delay to prevent these redundant systems from "short-circuiting" my logic.

Any ideas? I'm sure there are logic gates available, I'm just too lazy to find it/would like to interact with the community.


-namiasdf
 

BlackFire

New Member
Jul 29, 2019
344
0
0
Computercraft. Get the nuclear display misc. peripheral for your liquid tank reader. When tank is full, turn redstone output on and sleep for 500. Then reset and wait till full.

Rinse and repeat.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
Computercraft. Get the nuclear display misc. peripheral for your liquid tank reader. When tank is full, turn redstone output on and sleep for 500. Then reset and wait till full.

Rinse and repeat.

My saviour. Are those things expensive to craft?

If you don't mind, could you explain to me the set up for those things? Some tips would be nice, any glitches, etc. I might have to worry about. I hate troubleshooting, heh.[DOUBLEPOST=1372623554][/DOUBLEPOST]Interesting solution as well. That way I don't have to purge the system entirely. Just a set amount. Beautiful.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
More questions.

So essentially I just have to have to run a while loop that waits for the redstone signal from the sensor to say that the tank is full. When that occurs, close the while loop and move on to the next statement. That statement will be the turn off the redstone signal that is controlling the MFSU and then sleep it.

Is there a sleep command? Do I have to run another while loop that waits for a certain amount of time to have passed? (I read in the documentation that there is a way for it to access the OS time. Using that as a reference, add x amount of time to that reference time and repeat the program from that.)

So Lua programming is basically block of statements? Statements are essentially a single command and you execute a block of statements as a program?

I wanted a relatively non-time consuming solution. I don't want to learn another programming language, though it could be useful in the future. Seems machine orientated.[DOUBLEPOST=1372625971][/DOUBLEPOST]A more simple solution.

Just extend a redstone pulse? Is there a way to extend the pulse by say.... 30 minutes? I need it to purge for about 30 minutes. Any time interval would work, but a longer time interval would definitely make for a more stable system. Redstone glitches >_>.

I thought turtle mining would be difficult, but since there is already an API.... Thanks for the introduction into a whole new world of FTB =D.
 

BlackFire

New Member
Jul 29, 2019
344
0
0
Your welcome :)

I'll see if I can address these one at a time.

The nuclear reader is cheep, this holds one card and no room for range upgrades, but the advanced nuclear reader is expensive requiring a nether star but you can hold 8 cards.

Setting up you use it like any other peripheral
Code:
reader = peripheral.wrap("put side here")
then you run the available commands. The one you want is called get().

So for example the code below
Code:
temp = ""
 
reader = peripheral.wrap("right")
 
temp = reader.get(1)
 
print(temp)

will print a table with the information of ID, Card State, Card Title, and Card Info. The one that you want is Card info so by typing

Code:
for i = 1, 8 do
 
  junk, junk2, junk3, stats = liquidReader.get(i)
  if states ~= nil then
    local j = 1
    while j < 3 do
      for label, value in pairs(stats) do
      liquidTable[i][j][1] = label
      liquidTable[i][j][2] = value
      j = j+1
      end
    end
  end
end

you collect the stats from the card and ignore the rest, check to see if there is a card in the slot selected (in case you use the Advanced Reader), then it takes each part of the information such as total liquid = 1000000000 and splits it into individual columns for easier transition.

More to follow
 

BlackFire

New Member
Jul 29, 2019
344
0
0
So essentially I just have to have to run a while loop that waits for the redstone signal from the sensor to say that the tank is full. When that occurs, close the while loop and move on to the next statement. That statement will be the turn off the redstone signal that is controlling the MFSU and then sleep it..

Not fully. I had this problem too when I was making one for energy. If you use a Liquid reader card, you will have to constantly check to see if the current liquid amount equal the total amount, and if that is true, start cycle. However a simper solution is to use a buildcraft gate to emit redstone signal when full. That way you don't have to mess around with the cards at all. And in this case you can run the pullEvent("redstone") which will cause the computer to wait until there is a change in the input of redstone to any of its sides. Once that occurs, you emit redstone from the computer to close the splitter to allow power to the MFSU. The run the sleep command like so
Code:
sleep(500)
and your computer will wait till time is up and go to your first pullEvent("redstone") statement repeating the cycle.

Programing is basicaly the easiest and best solution you can do the quickest. So I would recommend using a gate reader with the following code

Code:
while true do
  os.pullEvent("redstone")
  redstone.setOutput("left", true)
  sleep(500)
  redstone.setOutput("left", false)
end

I think that should be all you need as the redstone coming from the tank is on the right side and the output to the splitter is on the left.