BillBodkin

Store

Sep 22nd, 2021 (edited)
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local storageComputerID = 18
  2. local chest = "enderstorage:ender_chest_6"
  3. local slot = 27
  4. local count = 64
  5.  
  6. rednet.open("back")
  7.  
  8. print("Storing " .. tostring(count) .. " " .. chest .. " slot " .. tostring(slot))
  9.  
  10. rednet.send(storageComputerID, {
  11.     ["action"] = "store",
  12.     ["instructionRef"] = "BillPhone",
  13.     ["chest"] = chest,
  14.     ["slot"] = slot,
  15.     ["count"] = count
  16. }, "inv")
  17.  
  18. while true do
  19.     local id, msg = rednet.receive("invResp")
  20.     if id == storageComputerID then
  21.         if msg["status"] == "success" then
  22.             print("Stored " .. tostring(msg["moved"]) .. " " .. chest .. " slot " .. tostring(slot))
  23.             return msg["moved"]
  24.         else
  25.             print("NOT Stored " .. chest .. " slot " .. tostring(slot) .. " - " .. msg["message"])
  26.             return 0
  27.         end
  28.     end
  29.     sleep(0)
  30. end
Add Comment
Please, Sign In to add comment