pepejik

Untitled

Nov 15th, 2024
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 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. local item = pim.getStackInSlot(i)
  18. if item then
  19. local count = item.qty
  20. print("Слот " .. i .. ': ' .. item.display_name .. ' - ' .. count .. ' шт.')
  21. if item.name == "ultimatePortableCell" or item.name == "draconiumFluxCapacitor" then
  22. pim.pushItemIntoSlot(CHEST_SIDE, i, 1, i)
  23. print('Импортировано ' .. item.display_name .. ' - ' .. count .. ' шт.')
  24. break
  25. end
  26. end
  27. end
  28. for i = 1, 8 do
  29. local item = pim.getStackInSlot(i)
  30. if item then
  31. local count = item.qty
  32. print("Слот " .. i .. ': ' .. item.display_name .. ' - ' .. count .. ' шт.')
  33. if item.name == "ultimatePortableCell" or item.name == "draconiumFluxCapacitor" then
  34. pim.pullItemIntoSlot(CHEST_SIDE, i * 2, 1, i)
  35. print('Экспортировано ' .. item.display_name .. ' - ' .. count .. ' шт.')
  36. break
  37. end
  38. end
  39. end
  40. end
  41. end
  42.  
  43. scanPlayer()
Add Comment
Please, Sign In to add comment