This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
flaghacker's profile picture

Openperipherals ae craft

Started by flaghacker, 28 April 2014 - 02:45 PM
flaghacker #1
Posted 28 April 2014 - 04:45 PM
I'm trying to make a computer that scans my applied energistics network for stored items and current crafting jobs using openpripherals. I also give it a table like this:

settings = {
name1 = {id1, amount1},
name2 = {id2, amount2},
...
}
Then the program has to determine how much it has to craft, and then do that.
I got all that, but I can't get the "craft" function to work. The only documentation is in-game, via a program called "docs".

> openp/docs left
prints all functions
SpoilercanHoldNewItem
containsItemType
countOfItemType
extractItem
getActivationEnergy
getAdvancedMethodsData
getAvailableItems
getEnergyStored
getFreeBytes
getJobList
getMJStored
getMaxEnergyStored
getMaxMJReceived
getMaxMJStored
getMaxSafeEUInput
getMinMJReceived
getName
getPreformattedItems
getPriority
getRemainingItemCount
getRemainingItemTypes
getStoredItemCount
getStoredItemTypes
getTotalBytes
getTotalItemTypes
getUnusedBytes
getUnusedItemCount
insertItem
isFuzzyPreformatted
isPreformatted
listMethods
requestCrafting


> openp/docs left requestCrafting
shows how to use that function, it prints

requestCrafting: Request crafting of a specific
item
returns: void
args:
- (table)stack: A table representing the item
stack
I don't understand any of this, but I tried:
This was my guess:

ae.requestCrafting({id, amount})
but no…
https://www.dropbox....estCrafting.PNG

Anyone knows how to use the requestCrafting method?
CometWolf #2
Posted 28 April 2014 - 08:32 PM
You're on the right track, but i believe the correct index is "qty", not "amount". There's also a third one for meta value, but i forgot what it is at the moment.
flaghacker #3
Posted 28 April 2014 - 09:09 PM
Oh you mean

ae.requestCrafting({id = 5, qty = 1})
I just did it without index. I'll try it tomorrow!
If it works, thanks!
CometWolf #4
Posted 28 April 2014 - 09:20 PM
Ah right, indeed i do. I didn't actually look at the picture :P/>
flaghacker #5
Posted 30 April 2014 - 04:03 PM
Thanks, it works!

ae.requestCrafting({id = <id>, qty = <quantity>, dmg = <metadata>})
Metadata is optional.
Edited on 30 April 2014 - 02:04 PM