Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rIronName = "IC2:item.itemIngotAdvIron"
- cCableName = "IC2:item.ic2cable"
- glassName = "minecraft:glass"
- coalDustName = "IC2:item.itemDustCoal"
- redstoneName = "minecraft:redstone"
- tinName = "IC2:item.itemIngotTin"
- cobbleName = "minecraft:cobblestone"
- circuitName = "IC2:item.itemPartCircuit"
- generatorName = "IC2:blockGenerator"
- furnaceName = "minecraft:furnace"
- casingName = "IC2:blockMachine"
- batteryName = "IC2:item.itemBatRE"
- items = {}
- function findNextEmptySlot()
- for x=1,16 do
- if turtle.getItemCount(x) == 0 then
- return x
- end
- end
- end
- function listenForRequest()
- sID, msg, prot = rednet.receive("Solar")
- return msg
- end
- function findItem(itemName)
- for x=1,16 do
- if item(x).name == itemName then
- return x
- end
- end
- return 0
- end
- function giveItems(slotNum, count)
- turtle.select(slotNum)
- turtle.dropDown(count)
- end
- function getAll()
- for x=1,90 do
- slot = findNextEmptySlot()
- if slot = 0 then
- return
- end
- turtle.Select(slot)
- turtle.suck()
- item(slot) = turtle.getItemDetail(x)
- end
- end
- rednet.open("right")
- getAll()
- item = listenForRequest()
- i = findItem(item.name)
- if i != 0 && item.count > turtle.getItemDetail(i).count >= item.count then
- giveItems(i, item.count)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement