Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is a test program for the Player Inventory Module (or PIM for short)
- term.clear()
- term.setCursorPos(1,1)
- -- Change the "" to whatever the label of the PIM is (e.g. touching the left side of the computer is "left", if it's labeled pim_1, use "pim_1")
- pim = peripheral.wrap("pim_2")
- -- A chest touching the East side of the PIM
- chest = "south"
- print("PIM Test 1")
- print("Pulling inventory from a player to a chest")
- print("Press \"enter\" to begin the test program")
- -- This makes it so the program pauses until you press enter
- read()
- -- size is the inventory size of whatever is on top of the PIM
- size = pim.getInventorySize()
- while size == 0 do
- term.clear()
- term.setCursorPos(1,1)
- print("No inventory detected!")
- print("Please stand on top of the PIM")
- size = pim.getInventorySize()
- sleep(1)
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Detected Inventory Size: " .. size .. " slots")
- print("Pulling from player inventory into the chest")
- for i = size, 1, -1 do
- print("Pulling from player slot " .. i)
- pim.pushItem(chest, i)
- end
- print("Inventory pulled. Test Program Done.")
Add Comment
Please, Sign In to add comment