This commit is contained in:
kepler155c
2018-10-27 23:16:16 -04:00
parent 57e7a574c4
commit dc6af1d0c3
4 changed files with 44 additions and 9 deletions

View File

@@ -5,6 +5,8 @@ local Socket = require('socket')
local device = _G.device
local turtle = _G.turtle
local SHIELD_SLOT = 2
local context = Milo:getContext()
local function getManipulatorForUser(user)
@@ -40,10 +42,19 @@ debug('remote: ' .. data.request)
socket:write(items)
elseif data.request == 'deposit' then
local count = manipulator.getInventory().pushItems(
context.localName,
data.slot,
64)
local count
if data.slot == 'shield' then
count = manipulator.getEquipment().pushItems(
context.localName,
SHIELD_SLOT,
64)
else
count = manipulator.getInventory().pushItems(
context.localName,
data.slot,
64)
end
socket:write({ count = count })
Milo:clearGrid()