Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pim = require("component").pim
- local event = require("event")
- local term = require('term')
- local CHEST_SIDE = 'south'
- --предметы, которые подлежат конфискации
- term.clear()
- function scanPlayer()
- while true do
- e, nick, uuid, adr = event.pull('player_on')
- if nick and nick ~= "Truncator" then
- return
- end
- term.clear()
- print('>>> Игрок: ' .. nick)
- for i = 1, 8 do
- local item = pim.getStackInSlot(i)
- if item then
- local count = item.qty
- print("Слот " .. i .. ': ' .. item.display_name .. ' - ' .. count .. ' шт.')
- if item.name == "ultimatePortableCell" or item.name == "draconiumFluxCapacitor" then
- pim.pushItemIntoSlot(CHEST_SIDE, i, 1, i)
- print('Импортировано ' .. item.display_name .. ' - ' .. count .. ' шт.')
- break
- end
- end
- end
- for i = 1, 8 do
- local item = pim.getStackInSlot(i)
- if item then
- local count = item.qty
- print("Слот " .. i .. ': ' .. item.display_name .. ' - ' .. count .. ' шт.')
- if item.name == "ultimatePortableCell" or item.name == "draconiumFluxCapacitor" then
- pim.pullItemIntoSlot(CHEST_SIDE, i * 2, 1, i)
- print('Экспортировано ' .. item.display_name .. ' - ' .. count .. ' шт.')
- break
- end
- end
- end
- end
- end
- scanPlayer()
Add Comment
Please, Sign In to add comment