Daraketh replied to Daraketh's question in RequestsHey all, Thought you might be interested to know I got a test program working. Turned out sleeping on it was the solution, had something working within 30 minutes of waking up. If anyone is interested in taking a look and helping out, please see below. Basic Setup: I don't actually use the adapter with an inventory controller just yet, but it will hopefully be moved to connect to the ME Controller, the adapter with a database, and the ender chest. The idea being the inventory controller will update the database with items stored in the ME system, if possible. The inventory controller adapter will also probably keep track of items in the ender chest. Test Program / Code: Pastebin (easier to read, has correct Lua syntax highlighting): http://pastebin.com/tm9f2hQR -- Title: me_exportbus test program -- -- File Name: test -- --Description: Reads all items in database and -- attempts to export 1 instance of -- each item to a chest through the -- export bus -- -- Notes: I use sides.bottom here, this will -- be different depending on the placement -- of your me_exportbus! I will eventually -- write a function to set this value -- dynamically (or maybe not, Im lazy) -- -- Keep in mind the database itemstack info -- is manually added at the moment, I will -- eventually add a means of using an inventory -- controller to manage the database programmatically -- (if possible with ME system) local component = require('component') local sides = require('sides') local db = component.database local cont = component.me_controller --not actually used local exBus = component.me_exportbus local busSide = sides.bottom --you might need to change this --for loop to print all the items in DB --should dynamically calculate end of loop for i = 1, 5 do item = db.get(i) print("--ITEM " .. i .. " START--") for k,v in pairs(item) do print(k,v) end print("--ITEM " .. i .. " END--") end print("\n\n") --for loop sets the export config to a different item --each loop, prints the config, then tries to export 1 item. --Should also dynamically calculated end of loop, but in actual --real use I probably will have a function along the lines of --exportItem(itemName) or something similar, which will do all --the work required to set the export config and pump out a single --instance of that item to the chest (resetting the config after) for i = 0, 4 do --start run i and set config for next item print("--------- Run " .. i .. " Start ---------\n") print("Set Config: ",exBus.setExportConfiguration(busSide, 1, db.address, i+1)) --print the config, comment this block out if you dont care config = exBus.getExportConfiguration(busSide, 1) print("\n!! Export Bus Config Start !!\n") for k,v in pairs(config) do print(k,v) end print("\n!! Export Bus Config End !!\n") print("Try Export: ",exBus.exportIntoSlot(busSide,i+1), "\n") -- try export an item end exBus.setExportConfiguration(0) --clear the config This uses hard coded values at the moment, but eventually I'll change this to use an inventory controller to manager the database and export items. Also, anyone know how to get Lua syntax highlighting in the code boxes? Problems: Solved: - As soon as I set the configuration on an export bus it instantly starts trying to pump that item out of the ME system. Solution was to use a Redstone Card upgrade in the export bus. Then set the Redstone Mode to Active with signal (then never send it a signal, so that exBus.exportIntoSlot is the only time it will try move an item). Unsolved: - I'm not sure if there is a way to get information about items in the ME system into the database. I did notice the latest version has added something to do exactly this though, so I may just have to wait until the mod pack my server uses get's an update.
Krutoy242 reacted to a question: Applied Energistics 2 using OC as an advanced import/export system
Daraketh posted a question in RequestsUPDATE: I finally got a test program working. See post below if interested. Going to leave this here as I make changes/improve the functionality, any pointers or suggestions are still more then welcome! Description: My friend and I are trying to get our OC computer to move items from an Applied Energistics 2 ME system into a chest (by any means) Function: I would like functionality that allows me to transfer items from my ME system into a chest, either through the export bus, or directly through a controller (if possible), or even using a robot, literally any means is great. Deadline: No deadline, would mostly just love some help. Additional Information: We've made preliminary attempts with ExportIntoSlot and various other methods on both the ME controller and the ME export bus. We've been using the github appeng intergration code as a reference from HERE to try achieve this, but have only had problems thus far. The greatest success so far is getting an export bus to return false with exportBus.exportIntoSlot(i,1) returning as false. I have previously managed to use a ComputerCraft turtle to do exactly this (I think using openPeripheral?), though this was with Applied Energistics 1. Thank you in advance! PS: If anyone is interested in having a crack, I can link some resources we've found that supposedly work, but none of the example code (or our various modifications to said example code) has worked thus far. I admit we're probably doing it wrong, any insight is great. PPS: Decided to include them anyways, see below if you're interested. https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration/appeng http://oc.cil.li/index.php?/topic/411-extracting-items-from-me-network-applied-energetics/ http://oc.cil.li/index.php?/topic/481-ae-item-management-puzzle-whats-the-best-way-to-do-this/