Advertisement
Robear9992

Robot Inventory Test - Open Computers

Apr 27th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. --os.execute("pastebin get -f py3vEYjK test.lua")
  2.  
  3. local inv = require("inventory")
  4. local sides = require("sides")
  5.  
  6. local COBBLE = { name = "minecraft:cobblestone", id = 4 }
  7. local DIRT = { name = "minecraft:dirt", id = 3 }
  8.  
  9. -- local full = inv.isFull() and "Yes" or "No"
  10. -- io.write("Is Full:     "..full.."\n")
  11.  
  12. -- local size = inv.size
  13. -- io.write("Size:        "..size.."\n")
  14.  
  15. -- local count = inv.count(1)
  16. -- io.write("Slot 1 Qty:  "..count.."\n")
  17.  
  18. -- local count2 = inv.count(COBBLE)
  19. -- io.write("Total Cobble:"..count2.."\n")
  20.  
  21. -- local isCont = tostring(inv.isContainer(sides.bottom))
  22. -- io.write("On Container:"..isCont.."\n")
  23.  
  24. io.write("Compacting...")
  25. inv.compact()
  26.  
  27. -- io.write("Selecting Cobble...\n")
  28. -- inv.select(COBBLE)
  29.  
  30.  
  31. -- io.write("\nEXTERNAL INVENTORY\n")
  32. -- local ex = inv.getExternal(sides.bottom)
  33. -- local count3 = ex.count(1)
  34. -- io.write("Slot 1 Qty:  "..count3.."\n")
  35.  
  36. -- local count4 = ex.count(COBBLE)
  37. -- io.write("Total Cobble:"..count4.."\n")
  38.  
  39. -- local full2 = ex.isFull() and "Yes" or "No"
  40. -- io.write("Is Full:     "..full2.."\n")
  41.  
  42. -- io.write("Deposit All...\n")
  43. -- ex.depositAll()
  44. -- io.write("Fetch All...\n")
  45. -- ex.fetchAll()
  46. -- io.write("Deposit Cobble...\n")
  47. -- ex.deposit(COBBLE)
  48. -- io.write("Fetch Cobble...\n")
  49. -- ex.fetch(COBBLE)
  50.  
  51.  
  52. -- io.write("Stocking 5 dirt...\n")
  53. -- ex.deposit(DIRT)
  54. -- inv.stock(sides.bottom, DIRT, 5)
  55.  
  56. io.write("Done\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement