Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Logistic Pipe request API
- Sylvyrfysh - All Rights Reserved
- Unauthorized copying, and/or redistribution of this file, via any medium without express written permission of Sylvyrfysh (Nicholas Johnson) is strictly prohibited
- Proprietary and confidential
- Written by Nicholas Johnson <johnnic431@gmail.com>, June 24 2015
- ]]
- local p=peripheral.wrap("bottom")
- function getItemsListRaw()
- return p.getAvailableItems();
- end
- function getItemsList(rawItems)
- if rawItems==nil then return false; end
- _tItems={}
- for t,y in pairs(rawItems) do
- _tItems[#_tItems+1]=y.getValue1();
- end
- return _tItems
- end
- function makeItemsList(plainList)
- _tList={}
- for t,y in pairs(plainList) do
- _tItem={}
- _tItem={["itemID"]=y.getId()..":"..y.getData(),["itemName"]=y.getName(),["amount"]=p.getItemAmount(y),["itemReference"]=y}
- _tList[#_tList+1]=_tItem
- end
- return _tList
- end
- function getItem(item,quantity)
- p.makeRequest(item,quantity)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement