Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
dieselfuelonly

Is it possible to populate a database without physical access to items?

Question

So I've been trying to write a program that can find unstackable/limited-stackability items within my AE2 network and export them to a different location.  From a lot of playing around with adapter blocks and looking the the documentation when connected to various AE2 components I've found that I can use getItemsInNetwork() function when connecting an Adapter Block to an ME Controller on a network.

local component = require("component")
local ser = require("serialization")

contents = component.proxy(component.list("mekanism")()).getItemsInNetwork()

for _,v in pairs(contents) do
    if not tonumber(v) then
        if v.hasTag or v.maxSize < 16 then
            print(v.name)
        end
    end
end

file = io.open("contents", "w")
file:write(ser.serialize(contents))
file:close()

The little program above finds items with NBT tags or a stack size of less than 16, and prints out the names of these items.  I was writing the table to a file as well just so I could have a better understanding of what information was contained within the item tables.

 

And yes, for some odd reason the ME Controller is referenced as a Mekanism block when connected to the Adapter block... lol.  No idea why.

 

Now, comes the part I'm stuck at, and which appears may not be possible - but maybe I'm just missing something:

 

In order to move items I would need to use an adapter block connected to an ME export bus.  The function used to set the configuration of the ME export bus needs a database entry containing the item I want the export.

 

The only way that I can find to write information to a database is by using the Inventory Controller module. And it appears that the store() function needs physical access to the item (whether in a robot slot, or in an inventory slot connected through an adapter/inv. controller when using a computer) in order to be able to create the database entry.  Since I'm only able to pull a table with information about the items from the ME network, but not physically access the items to be able to use the store() function on, I can't seem to get anywhere.

 

Am I missing something or is it just not possible to do what I'm trying to accomplish?

 

 

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The `mekanism` thing should be fixed in the new version. Should :P

 

Hmm, yeah, I guess you'd need something to configure a DB from the AE network... something like `store(filter, db)` writing all results of the query to the specified database? Make an issue on Github for something like that.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.