Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------------------------------------------------------------------
- --[[
- Скан игрока (инвентаря, эффектов, брони). Версия 0.2;
- "ScanPlayer 0.2" by Dronax;
- Кто спиздит тот пидорас;
- ]]--
- ---------------------------------------------------------------------------------------------------------------------------------------
- local term = require("term")
- local component = require("component")
- local event = require("event")
- local gpu = component.gpu
- local exit = 0
- local buffer = 1
- ---------------------------------------------------------------------------------------------------------------------------------------
- if component.isAvailable("openperipheral_sensor") then
- openperipheral_sensor = component.openperipheral_sensor
- else
- print("Install the sensor in your computer | Установите сенсор в ваш компьютер")
- os.exit()
- end
- ---------------------------------------------------------------------------------------------------------------------------------------
- function helmet_armor() -- Проверка шлема
- helmet = openperipheral_sensor.getPlayerByName(player).all().living.armor.helmet
- if helmet == nil then
- gpu.set(3, 3, "Helmet: nil")
- else
- gpu.set(3, 3, "Helmet: " .. helmet.display_name)
- end
- end
- function chestplate_armor() -- Проверка нагрудника
- chestplate = openperipheral_sensor.getPlayerByName(player).all().living.armor.chestplate
- if chestplate == nil then
- gpu.set(3, 4, "ChestPlate: nil")
- else
- gpu.set(3, 4, "ChestPlate: " .. chestplate.display_name)
- end
- end
- function leggings_armor() -- Проверка поножей
- leggings = openperipheral_sensor.getPlayerByName(player).all().living.armor.leggings
- if leggings == nil then
- gpu.set(3, 5, "Leggings: nil" )
- else
- gpu.set(3, 5, "Leggings: " .. leggings.display_name)
- end
- end
- function boots_armor() -- Проверка ботинок
- boots = openperipheral_sensor.getPlayerByName(player).all().living.armor.boots
- if boots == nil then
- gpu.set(3, 6, "Boots: nil")
- else
- gpu.set(3, 6, "Boots: " .. boots.display_name)
- end
- end
- function effect() -- Проверка эффектов
- potion_effects = openperipheral_sensor.getPlayerByName(player).all().living.potion_effects
- gpu.set(3,7, "Effects:")
- for i = 1, #potion_effects do
- gpu.set(3, 7+i, "Effect " .. i .. ": " .. potion_effects[i].effect.name)
- end
- end
- function scan_inventory() -- Скан игрока
- for i = 1, 36 do
- inventory = openperipheral_sensor.getPlayerByName(player).all().player.inventory
- if inventory[i] == nil then
- else
- buffer = buffer + 1
- gpu.set(52, buffer, "Slot " .. i .. ": " .. inventory[i].all().display_name .. " | Amount: " .. inventory[i].all().qty)
- end
- end
- wait()
- end
- function main_graphic() -- менюшка
- gpu.setResolution(160, 50)
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- term.clear()
- gpu.setBackground(0xC5C5C5)
- gpu.fill(1, 1, 160, 1, " ")
- gpu.fill(1, 50, 160, 1, " ")
- gpu.fill(1, 1, 1, 50, " ")
- gpu.fill(160, 1, 1, 50, " ")
- gpu.setForeground(0x0900FF)
- gpu.set(20, 1, "Preferences")
- gpu.set(105, 1, "Inventory")
- gpu.set(160, 1, "X")
- gpu.set(151, 50, "by Dronax")
- gpu.fill(50, 1, 1, 50, " ")
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- end
- function hello() -- запуск
- print("Введите ник игрока которого хотите про сканировать")
- player = io.read()
- term.clear()
- main_graphic()
- main_scan()
- end
- function main_scan() -- всеобщий скан
- gpu.set(3, 2, "Name: " .. player)
- helmet_armor()
- chestplate_armor()
- leggings_armor()
- boots_armor()
- effect()
- scan_inventory()
- end
- function wait() -- ожидает закрытия
- while true do
- event.pull("touch")
- if exit == 1 then
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- term.clear()
- os.exit()
- end
- end
- end
- function exit(touch, uuid, x, y, mouse, name) -- изменение переменной
- if x == 160 then
- if y == 1 then
- if mouse == 0 then
- exit = 1
- end
- end
- end
- end
- ---------------------------------------------------------------------------------------------------------------------------------------
- event.listen("touch", exit)
- hello()
- ---------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement