pepejik

Untitled

Nov 15th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. local pim = require("component").pim
  2. local event = require("event")
  3. local term = require('term')
  4. local CHEST_SIDE = 'south'
  5.  
  6. --предметы, которые подлежат конфискации
  7. term.clear()
  8. function scanPlayer()
  9. while true do
  10. e, nick, uuid, adr = event.pull('player_on')
  11. if nick and nick ~= "Truncator" then
  12. return
  13. end
  14. term.clear()
  15. print('>>> Игрок: ' .. nick)
  16. for i = 1, 8 do
  17. if pim.getStackInSlot(i) then
  18. local count = pim.getStackInSlot(i).qty
  19. print("Слот " .. i .. ': ' .. pim.getStackInSlot(i).display_name .. ' - ' .. count .. ' шт.')
  20. for j = 1, #ITEMS do
  21. if pim.getStackInSlot(i).name == "ultimatePortableCell" or pim.getStackInSlot(i).name == "draconiumFluxCapacitor" then
  22. pim.pushItemIntoSlot(CHEST_SIDE, i, 1, i)
  23. print('Импортировано ' .. ITEMS[j] .. ' - ' .. count .. ' шт.')
  24. break
  25. end
  26. end
  27. end
  28. if pim.getStackInSlot(i).name == "ultimatePortableCell" or pim.getStackInSlot(i).name == "draconiumFluxCapacitor" then
  29. pim.pull(CHEST_SIDE, i*2, 1, i)
  30. print('Импортировано ' .. ITEMS[j] .. ' - ' .. count .. ' шт.')
  31. break
  32. end
  33. end
  34. end
  35. end
  36.  
  37. scanPlayer()
Add Comment
Please, Sign In to add comment