pepejik

Untitled

Nov 15th, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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. end
  29. for i = 1, 8 do
  30. if pim.getStackInSlot(i) then
  31. local count = pim.getStackInSlot(i).qty
  32. print("Слот " .. i .. ': ' .. pim.getStackInSlot(i).display_name .. ' - ' .. count .. ' шт.')
  33. for j = 1, #ITEMS do
  34. if pim.getStackInSlot(i).name == "ultimatePortableCell" or pim.getStackInSlot(i).name == "draconiumFluxCapacitor" then
  35. pim.pullItemIntoSlot(CHEST_SIDE, i*2, 1, i)
  36. print('Экспортировано ' .. ITEMS[j] .. ' - ' .. count .. ' шт.')
  37. break
  38. end
  39. end
  40. end
  41. end
  42. end
  43. end
  44.  
  45. scanPlayer()
Add Comment
Please, Sign In to add comment