Does anyone have a simple working script, that uses the playerinterface from the peripheral++ mod?
Link to documentation: http://peripheralspl...ayer_interface/
Peripierals++- Using the playerinterface
Started by gheotic, Oct 27 2015 08:57 AM
2 replies to this topic
#1
Posted 27 October 2015 - 08:57 AM
#2
Posted 27 October 2015 - 09:55 AM
First wrap the peripheral as normal:
Supposing you have a chest to the north of your computer, you would want to input and output into that chest. You also would want to get the inventory of the desired player
If you want to move something from slot 1 of the chest to the player:
If you want to pull something from slot 1 of the player to the chest, just do it in reverse:
local p = peripheral.wrap("left")
Supposing you have a chest to the north of your computer, you would want to input and output into that chest. You also would want to get the inventory of the desired player
p.setOutputSide("north")
p.setInputSide("north")
local inv = p.getPlayerInv("dan200")
If you want to move something from slot 1 of the chest to the player:
inv.pushToSlot(1, 64, -1) -- 64 to pass all items, -1 to pass to any slot. You can change this to force a slot and limit the number of items
If you want to pull something from slot 1 of the player to the chest, just do it in reverse:
inv.retrieveFromSlot(1, 64, -1)
#3
Posted 27 October 2015 - 11:20 AM
SquidDev, on 27 October 2015 - 09:55 AM, said:
First wrap the peripheral as normal:
Supposing you have a chest to the north of your computer, you would want to input and output into that chest. You also would want to get the inventory of the desired player
If you want to move something from slot 1 of the chest to the player:
If you want to pull something from slot 1 of the player to the chest, just do it in reverse:
local p = peripheral.wrap("left")
Supposing you have a chest to the north of your computer, you would want to input and output into that chest. You also would want to get the inventory of the desired player
p.setOutputSide("north")
p.setInputSide("north")
local inv = p.getPlayerInv("dan200")
If you want to move something from slot 1 of the chest to the player:
inv.pushToSlot(1, 64, -1) -- 64 to pass all items, -1 to pass to any slot. You can change this to force a slot and limit the number of items
If you want to pull something from slot 1 of the player to the chest, just do it in reverse:
inv.retrieveFromSlot(1, 64, -1)
Thank you! i dont know where i went wrong when trying this myself, but your script works like a charm!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











