Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- local storageComputerID = 18
- local chest = "enderstorage:ender_chest_6"
- local slot = 1
- function Get(itemName, itemCount, chest, slot)
- print("Getting " .. tostring(itemCount) .. " " .. chest .. " slot " .. tostring(slot))
- rednet.send(storageComputerID, {
- ["action"] = "get",
- ["instructionRef"] = "outChestTopup",
- ["chest"] = chest,
- ["slot"] = slot,
- ["name"] = itemName,
- ["count"] = itemCount
- }, "inv")
- while true do
- local id, msg = rednet.receive("invResp")
- if id == storageComputerID then
- if msg["status"] == "success" then
- print("Got " .. tostring(msg["moved"]) .. " " .. chest .. " slot " .. tostring(slot))
- return msg["moved"]
- else
- print("NOT Got " .. chest .. " slot " .. tostring(slot) .. " - " .. msg["message"])
- return 0
- end
- end
- sleep(0)
- end
- end
- if args[1] == nil or (args[2] ~= nil and tonumber(args[2]) == nil) then
- print("Usage: get name <count>")
- else
- local count = tonumber(args[2])
- if count == nil then
- count = 1
- end
- Get(args[1], count, chest, slot)
- end
Add Comment
Please, Sign In to add comment