Self-aware ME network...possible?

  • 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

malicious_bloke

Over-Achiever
Jul 28, 2013
2,961
2,705
298
This might sound totally daft, but I thought it might be an amusing project.

What I want to make is a setup on my ME network where it will detect full storage on the ME drive and automatically command itself to build another 64k storage bus AND insert it automatically.

Now, i'm not sure how possible any of these stages are but I envisage something using a level emitter and an export bus on the drives. Would any of this even work?
 
  • Like
Reactions: WatcherInTheShadows

b0bst3r

New Member
Jul 29, 2019
2,195
0
1
With just AE no I doubt it, but I can think of a couple of ways that may be possible combining turtles and BC pipes/Autarchic gates.
 

BanzaiBlitz

New Member
Jul 29, 2019
429
0
0
Without touching turtles at all, this could be done with pipes. You have further options with things like Factorization routers.

Granted, a little tricky and probably will demand a modicum of space but an autarchic gate responding to a level emitter RS signal off a chest (Dirt chest? :p) that is set to always keep a fresh 64k storage drive ready and run by pipe down a line of ME drive bays or whatever they're called. More bays and connected pipes as required. Nice that AE bits all interconnect no matter the chain. :D

Edit: Actually, almost entirely in AE is reasonable. Just have an overflow chest with a basic import bus and storage bus. Upon items being detected in the chest, craft and place a new 64k drive. Precision exports work with single pulse on RS signal, so should be easy to daisy-chain the drive bays with an export bus on top. Drives only drop in when the network is full. Whether you plan far ahead or add drive bays as required is up to you. The basic import bus on the overflow chest simply pulls the excess back in.
 
  • Like
Reactions: Cirom

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
Open peripherals is probably a good fit for this project. You can wrap loads of the AE blocks as computer peripherals. http://www.openperipheral.info/openperipheral/documentation/appliedenergistics/me-controller

I have linked to the documentation on the ME controller. If you wrap it as a peripheral you can use several methods including retrieving how much total storage you have in AE, how much free storage and how much used storage you have. It also looks like it can detect how many item types it has free. Finally, there is a method that called requestCrafting(). I don't really know how it works but maybe you can request the crafting of the cell using that. If not you could definitely pull it off with misc peripherals and the ME bridge or just pulse an export bus set to craft the the cell into a router for your ME drive bank.
 

the_j485

King of the Wicked
Dec 19, 2012
2,964
3,099
298
Look behind you
I want to see this done :p

If you do this with turtles it will be extremely simple, just make it check every now and then and if it detects that it is full using open peripherals then it requests some drives and storage blocks and sets them up.
 

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
I have made a system that works. Thank you malicious_bloke for posing this query. It was an excellent idea which merged quite well with a plan I was already working on. I have been writing a program that already interfaces heavily with Applied Energistics and this fits right in to my project.

Anyway, to actually demonstrate my solution. (Inside spoiler :) ).

Requires at least Computer craft and open peripherals. Misc peripherals is useful to have also.

Here is a picture of my set up

2013-10-24_23.55.00.png

I have wrapped the ME controller as a peripheral to the computer. This computer can monitor the storage in the AE system. I have it checking bytes used and item slots used as a percentage and if either of those goes above 90% full then the computer emits a 2 redstone pulse. This triggers a precision export bus to craft/export and trigger once per pulse to put a storage cell into a router. The router then puts the cell into one of the me drives. I put a machine filter on the router just to be on the safe side. I only tested it with the 1k cell so I don't know how it will do with more complex crafts. However, it worked like a treat for me. The program I wrote to control it is a bit rough and ready and is only really suitable for testing and as a proof of concept. Here are some more screenshots. (There is an ME bridge in my set up. The program will crash without it but it is not actually doing anything essential for this to work.).

2013-10-24_23.55.39.png

2013-10-24_23.55.09.png

Above: Just an example of the computer program output. The data at the top is just the output of the ME bridge and not really important. Below is the data about te storage including the percentages that determine if more storage needs to be made.

2013-10-24_23.56.14.png

Above: From behind you can see the export bus in a position to put the storage cells in the router. Below: Precision Export bus GUI

2013-10-24_23.56.00.png

2013-10-24_23.55.57.png

-----

Like I said, the code is very rudimentary but I will include it anyway.

Code:
local controller = peripheral.wrap("right")
local bridge = peripheral.wrap("back")
 
function storageDetail()
local storage = controller.getTotalBytes()
local storageUsed = controller.getUsedBytes()
local storageRemaining = controller.getFreeBytes()
local itemTypesInStorage = controller.getStoredItemTypes() - 1
local maxItemTypes = controller.getTotalItemTypes()
print("Total Storage: "..storage)
print("Current Usage: "..storageUsed.."/"..storageRemaining)
print("Item Slots Occupied: "..itemTypesInStorage.."/"..maxItemTypes)
local x = math.ceil(storageUsed/storage*100)
local y = math.ceil(itemTypesInStorage/maxItemTypes*100)
return x,y
end
 
function getContents()
local list = bridge.listAll()
print("ME Contents")
for i,v in pairs(list) do
print(i..":"..v)
end
print("")
end
 
local looping = true
while looping do
term.clear()
term.setCursorPos(1,1)
getContents()
local x,y = storageDetail()
print(x.."%")
print(y.."%")
 
if x >= 90 or y >= 90 then
print("Making extra storage")
redstone.setBundledOutput("top", 1)
sleep(2)
redstone.setBundledOutput("top", 0)
looping = false
end
sleep(10)
end

I am going to enjoy implementing a more advanced version of this soon. I hope other people can make use of it too.