Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("japi")
- rednet.open("right")
- pipe = peripheral.wrap("back")
- atmid = 3738
- lpm = japi.getModule("logisticPipes")
- lpm.request.setRequestSide("bottom")
- lpm.request.initPipe()
- function empfangen()
- id,redi = rednet.receive()
- if id == atmid then
- data = textutils.unserialize(redi)
- item = data.item
- menge = data.menge
- end
- end
- while true do
- empfangen()
- if item == "tungsten" then
- lpitems = lpm.request.getItems(false, true)
- lpitem = lpm.convert.getSpecificItem(lpitems, 254)
- --print(textutils.serialize(lpitem))
- if (lpitem ~= nil) then
- if (lpitem.damage == 6 and lpitem.amout >= menge) then
- pipe.makeRequest(pipe.getItemIdentifierIDFor(254, 6), menge)
- --print("requestet")
- rednet.send(atmid, "5")
- else
- rednet.send(atmid, "3")
- end
- else
- rednet.send(atmid, "3")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement