9 posts
Posted 07 September 2014 - 09:56 PM
Hi, im having a problem with the logistic pipes integration since the code changes, can any learned ppl here tell me how to convert this function which requests every item available so it works with the new functions ?
local items = activerequestor.getAvailableItems()
for _,item in pairs(items) do
local id = item[1]
local name = activerequestor.getUnlocalizedName(id)
activerequestor.makeRequest(id,1)
end
Thanks :)/>
7083 posts
Location
Tasmania (AU)
Posted 08 September 2014 - 01:18 AM
Assuming you're talking about OpenPeripheral, there's a "docs" script in later builds which you should be able to use to get this info.
To get a list of functions a block has:
openp/docs <side>
To get more details on individual functions:
openp/docs <side> <methodname>
9 posts
Posted 08 September 2014 - 05:43 PM
Assuming you're talking about OpenPeripheral, there's a "docs" script in later builds which you should be able to use to get this info.
To get a list of functions a block has:
openp/docs <side>
To get more details on individual functions:
openp/docs <side> <methodname>
Im not, sadly Open Peripherals doesnt support logistics pipes because it has its own API which is totally different to OP's methods :(/>
7083 posts
Location
Tasmania (AU)
Posted 09 September 2014 - 02:18 AM
In that case, in the Lua console:
textutils.tabulate(peripheral.getMethods("<side>"))
9 posts
Posted 10 September 2014 - 09:13 AM
In that case, in the Lua console:
textutils.tabulate(peripheral.getMethods("<side>"))
yeah i have the api commands already they are listed on the wiki, my problem is that the tables returned from .getAvailableItems etc contain functions rather than strings and i cant seem to work out how to use them :)/>
7083 posts
Location
Tasmania (AU)
Posted 10 September 2014 - 12:41 PM
Are you sure those tables contain
functions? As opposed to, say, more tables? :huh:/>
I'm not familiar with the pipes myself, nor am I certain which wiki page you're referring to.
I suspect you might find
this worth a read.
9 posts
Posted 13 September 2014 - 01:50 AM
Are you sure those tables contain
functions? As opposed to, say, more tables? :huh:/>
I'm not familiar with the pipes myself, nor am I certain which wiki page you're referring to.
I suspect you might find
this worth a read.
Yeah i saw that, its not the OpenPeripherals problem, the actually wrapping seems to work fine, the logistics pipes/computercraft api wiki here at
http://rs485.thezorro266.com/wiki/ComputerCraft_API seems to be outdated as several of these methods are not visible anymore when wrapping a pipe with the latest version, i can use the .getAvailableItems method to return a contents table, but when i try to recurse it using standard in pairs methods the item tables are full of functions and trying to work out how to access them goes beyond my limited understanding :)/>
7083 posts
Location
Tasmania (AU)
Posted 13 September 2014 - 02:56 AM
I guess you're doing something like this:
local data = activerequestor.getAvailableItems()
for key,value in pairs(data) do print(value) end
This'll list off "function: 344542r34 function: 45234235434t function: 234234234" etc.
If you print "key" instead of "value", you'll get the names needed to actually access those functions. For example, if one of the lines says "fishBeans", then that means you would run that function by entering "data.fishBeans()".