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

Library for exporting Items from applied energistics 2 over interface

Recommended Posts

Hi lads and lassies,

 

i'm coding on my galacticraft moon base and have made a library for exporting items from an ae2 network.

The handling is very easy. Just connect an adapter to an ae2 interface block and any kind of container (chest, machine) to one side of the interface. Set the direction the interface is connected to the chest.

Items to export will be selected by display name, not with fingerprint. To export dirt use Dirt as item, not minecraft:dirt.

 

Example code:

local component = require("component")
local meinterface = require("interface_lib")

io.write("Set direction to SOUTH : ")
print(meinterface.setDirection("SOUTH"))

for k, v in pairs(meinterface.getItemList()) do
  print(k, v.size, v.label)
end

io.write("Exporting 5 Dirt ")
print(" " .. tostring(meinterface.export("Dirt", 5, true)))


library functions:

 

setDirection(direction)

  -- has to be called before using the lib to set the direction interface is connected to a container

  -- can be UP, DOWN, NORTH, EAST, SOUTH or WEST

 

getItemList()

  -- Retruns a table with size and label of all items in me network

 

export(label, amount, dots)

  -- Exports an amount of items with the given label

  -- If dots is true it will write a dot for every item exportet (helpfull to see if it's still working when exporting big amounts)

 

setExportTime(time)

  -- different containers needs different time to wait for finishing the export. A cargo loader for example needs 0.8 seconds and a chest

  -- only 0.5 seconds

 

 

Here is the lib on pastebin.

http://pastebin.com/HMeRTXZ5

 

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
Reply to this topic...

×   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.