Jump to content




[mc 1.6.2] [cc 1.56] Applied Energistics Peripheral


48 replies to this topic

#1 Pharabus

  • Members
  • 18 posts

Posted 08 May 2013 - 07:29 AM

Title: Applied Energistics Peripheral

This is actually a repost as the original was lost in the 5 day void :)

AE Peripheral is a ComputerCraft peripheral that exposes 3 methods to interface with Applied Energistics, it works in MC 1.6.2 with all v13 AE version and Computercraft 1.55

it is crafted (where X is smooth stone, Y is an ME cable and Z is redstone) as below

XXX
YZX
XXX

the 4 methods are

"GetInventory", "GetCraftables", "Craft", "AddAlert"

GetInventory has no Params and returns a table where Key is the item name and Value is the count, this is a list of items in the AE grid

GetCraftables has no params and returns a table where Key is the item name and Value is the item ID, item damage concactinated with ":" , this is a list of things you can craft via AE

Craft takes 2 params, param 1 is the item Id,item damagae concactinated with ":" (this matches the return from getCraftables ":0" is needed for items with no damage) to craft and param 2 is the count

AddAlert allows you to add a number of alerts params are event name, Id,damage (again concactinated with a ":" a ":0" is needed for items with no damage) and 2 params for min and max, setting min to 0 or max to 0 defines the alert differently, example below

download link
https://dl.dropboxus...6.2-1.0.1.1.zip

alert example
if Min is 0 and max is > 0 then alert will happen if count of item >= max
if max is 0 and min is > 0 then will happen if count of item <= min
if max and min are both > 0 the alert will happen if count is >= min AND <= max

updated to 1.0.0.2
change: added damage values

updated to 1.0.0.3
change: removed debug spam

updated to 1.0.1.0
change: CC 1.56 AE rv13 MC 1.6.2
graphical changes

updated to 1.0.1.1
change: sorted the block update glitch

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,399 posts

Posted 08 May 2013 - 11:47 AM

I'm not sure how this ended up in Ask a Pro. I think someone didn't look at what they were splitting. ;)/>

Moved to Peripherals.

#3 dsuser97

  • Members
  • 5 posts

Posted 09 May 2013 - 03:40 PM

The mcmod.info doesn't work, it has to be
"version": "1.0",
instead of
"version": "1.0,

Anyways, it would be great if this could extract items out of the System.

#4 Pharabus

  • Members
  • 18 posts

Posted 10 May 2013 - 06:39 AM

thanks for the feedback, i have updated the typo in the mcmod.info

MiscPeripherals has the ability to extract via its ME Bridge so I don't really want to work on that aspect, I do have a couple of ideas I am working on to differentiate my peripheral though


P

#5 Pharabus

  • Members
  • 18 posts

Posted 12 May 2013 - 10:54 AM

updated to include AddAlert

example LUA for alert (this is just my test script so excuse the simplistic nature) it checks the level of stone in the system (blockid 1)

testalarm1 fires if the level of stone changes and is between 10 and 50 (inclusive)
testalarm2 if the level of stone changes and is <= 10
testalarm3 if level of stone changes and is >=50

m= peripheral.wrap("left")
m.AddAlert("testalarm1","1:0",10,50)
m.AddAlert("testalarm2","1:0",10,0)
m.AddAlert("testalarm3","1:0",0,50)
while true do
  local event,param1 = os.pullEvent()
  if event == "testalarm1" then
	print("range alarm "..param1)
  elseif event == "testalarm2" then
	print("min alarm " ..param1)
  elseif event == "testalarm3" then
	print("max alarm " .. param1)
  else
	sleep(1.5)
  end
end

Pharabus

edited to reflect need for damage value

#6 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 12 May 2013 - 11:38 AM

Would it be possible to port this to MC 1.4.7? Redpower and some other mods are not available for 1.5.1 and I'd like to use them too.

#7 Pharabus

  • Members
  • 18 posts

Posted 12 May 2013 - 11:41 AM

View Postxuma202, on 12 May 2013 - 11:38 AM, said:

Would it be possible to port this to MC 1.4.7? Redpower and some other mods are not available for 1.5.1 and I'd like to use them too.

I did consider this but I don't have a huge amount of time spare to work on this, if i get a chance i will post

#8 gknova61

  • Members
  • 74 posts

Posted 16 May 2013 - 01:38 PM

Maybe add an inventory for it so it can retrieve items from AE, and check ongoing crafting jobs to see if what you crafted has been crafted? It'd make it much more useful than openccsensors

#9 vitzli

  • New Members
  • 2 posts

Posted 06 June 2013 - 08:07 AM

Could you please add support for meta (damage) value for Craft() and GetCraftables() methods? There is no way to request crafting of items with non-zero damage value (like Orange wool 35:1, Solar panel 246:3, and so on).

#10 Pharabus

  • Members
  • 18 posts

Posted 11 June 2013 - 12:24 PM

View Postvitzli, on 06 June 2013 - 08:07 AM, said:

Could you please add support for meta (damage) value for Craft() and GetCraftables() methods? There is no way to request crafting of items with non-zero damage value (like Orange wool 35:1, Solar panel 246:3, and so on).

I will look into that, it's a good point

#11 Pharabus

  • Members
  • 18 posts

Posted 12 June 2013 - 06:42 AM

updated to include damage values to Craft, getCraftables and AddAlert

#12 ingie

  • Members
  • 69 posts
  • LocationMannin

Posted 16 June 2013 - 11:33 AM

loving this mod... already got my OpenPeripheral glasses showing me my AE things and stuff :)

one thing tho, could you add a config option to stop the server log spam, pleeeease :)

it's just i'm trying to build my own home server with as many uber mods in it as i can manage, so extra server spam from things that are working fine tends to get in the way of actual server errors and such...

the two that seem to happen are:

"networkchanged called" whenever, well, whenever the network changes ;) [ e.g. if i take or drop something into the AE network ]
and
"AEPeripheral getGrid called my grid istrue" whenever i check an inventory slot...

i don't mind the initialisation logging of course, so something like a debug level setting would be nice: e.g. off,errors,verbose type of thing :)

otherwise: since i found AE the other day and went "wooo", this mod - simple as it is - has made me go "wooooooooooo" :D

#13 Pharabus

  • Members
  • 18 posts

Posted 17 June 2013 - 07:24 AM

View Postingie, on 16 June 2013 - 11:33 AM, said:

loving this mod... already got my OpenPeripheral glasses showing me my AE things and stuff :)

one thing tho, could you add a config option to stop the server log spam, pleeeease :)

it's just i'm trying to build my own home server with as many uber mods in it as i can manage, so extra server spam from things that are working fine tends to get in the way of actual server errors and such...

the two that seem to happen are:

"networkchanged called" whenever, well, whenever the network changes ;) [ e.g. if i take or drop something into the AE network ]
and
"AEPeripheral getGrid called my grid istrue" whenever i check an inventory slot...

i don't mind the initialisation logging of course, so something like a debug level setting would be nice: e.g. off,errors,verbose type of thing :)

otherwise: since i found AE the other day and went "wooo", this mod - simple as it is - has made me go "wooooooooooo" :D

hehe. I totally forgot about my debug messages :)

updated to 1.0.0.3 to remove debug spam

thanks for the feedback

P

#14 ingie

  • Members
  • 69 posts
  • LocationMannin

Posted 17 June 2013 - 08:05 AM

no problem... i'm always doing the same thing in my day job... about 15 years back i was doing a system for a client and one of their testers emailed me a screenshot where at the bottom of the screen it said [arse] - he asked me whether this was meant to happen... i replied "only if something happens outside the bounds of my switch condition" - luckily it wasn't a live system.

i try and use less laconic error messages now, at least. :)

cheers for the update, i'll apply that later :)

#15 LaughingLeader

  • Members
  • 9 posts

Posted 23 June 2013 - 03:58 AM

This is a great mod! it's (almost) exactly what I need to finish my sorting program for my AE network. I just have one question/request.

Would it be possible to get the item ID, along with the name and amount? I'm trying to use this peripheral together with the ME Bridge, and getting the item ID would allow me to retrieve the item with the ME Bridge.

I'm doing my sorting more globally, rather than hard-coding in item IDs. So, for instance, if the item has "Ore" in its name, I'd like to get its item ID and have the ME Bridge send it to be crushed into dust.

Currently, I have no way to match the table your peripheral makes to the table the ME Bridge makes, since the ME Bridge doesn't give you the item name, and your peripheral doesn't give the item ID. That one change would allow them to really synergize together.



As a curious side note, for whatever reason, the size of AE Peripheral's GetInventory() table and the ME Bridge's listItems() never seem to match up for me. ME Bridge's table is usually higher than the other one.

I get those sizes from doing some simple loops:

local itemIDs = bridge.listItems(); -- ME Bridge
local itemNames = checker.GetInventory(); -- AE Peripheral
local size1 = 0;
local size2 = 0;

for k, v in pairs(itemIDs) do
  size1 = size1+1;
end

for k, v in pairs(itemNames) do
  size2 = size2+1;
end
print("Sizes: " ,size1,", ", size2);
-- Currently I get something like this printing:
-- Sizes: 210, 202

Thanks.

#16 BakermanLP

  • Members
  • 10 posts
  • LocationGermany

Posted 01 July 2013 - 02:37 AM

Hello there,

may I add this mod to my Modpack?

Most informations will be found at https://github.com/B...necraftLetsPlay

The target audience are my fellowers on Youtube (actually about 30-50 people).

Full credits will be included in the modpack with your name and a link to this thread.

Thanks for replay.

Michael (aka BakermanLP)

#17 Pharabus

  • Members
  • 18 posts

Posted 05 July 2013 - 02:43 AM

Hi,

sorry for the delay in replying, I am out of the Country currently on some personal business that came up unexpectedly,

as far as mod packs, I am very happy for the mod to be included, credit would be appreciated,

I will look into adding the item ids as requested, possibly when i upgrade to 1.6.*, I have not used ME bridge so I am unsure why there is difference in size but again I will look at that when I am back home

thanks so much for the feedback and interest

P

#18 Pharabus

  • Members
  • 18 posts

Posted 30 July 2013 - 01:18 PM

Hi,

I currently have a dev version updated to 1.6.2 and I am adding a few look and feel features to it (blinky lights incoming!) should have something released in a few days,

I will look to add the itemIds, should be possible,

I did take a look at the ME bridge count and from what I can see RG and I both make the same call to AE for my GetInventory and and his ListItems so I am still a little unsure what is happening there, i will try and set up a test environment to see if I can figure it out.

P

#19 Pharabus

  • Members
  • 18 posts

Posted 11 August 2013 - 12:09 PM

updated to 1.6.2

added a graphical update to show connectivity status on the front, this has for some reason led to the need for a block update to show the AE cables connecting (it is purely visual though) i will look into whats causing it fixed in 1.0.11

i think I misunderstood the post above requesting item Ids on GetInventory (I thought you meant damage values) when I looked into it ME Bridge uses a hash of the item ID + damage, i would need to know RGs seed and emulate to make it do what you want, not something I can really do


thanks

P

#20 schussi24

  • New Members
  • 1 posts

Posted 18 August 2013 - 03:46 PM

Could you please upload the version for 1.5.2? I've got some old mods running which are not updated to 1.6.2

EDIT: Already found it in your dropbox folder





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users