Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Config ]]--
- whitelist = true
- defaultPlayer = "RandomShovel"
- --[[ Variables ]]--
- local sensor = peripheral.wrap("top")
- --[[ Tables ]]--
- whitelist = {}
- --[[ Get Nearby Players ]]--
- nplay = sensor.getPlayerNames()
- --[[ Get Whitelist ]]--
- if fs.exists("dwlist") then
- file = fs.open("dwlist", "r")
- for line in io.lines("dwlist") do
- table.insert(whitelist, line)
- end
- file.close()
- else
- file = fs.open("dwlist", "w")
- file.write(defaultPlayer)
- file.close()
- end
- --[[ Main ]]--
- for a=1, #nplay do
- if whitelist then
- for d = 1, #whitelist do
- if nplay[a] == whitelist[d] then
- printError("Player "..nplay[a].." is whitelisted!")
- protected = true
- break
- else
- curPlay = sensor.getPlayerData(nplay[a])
- protected = false
- end
- end
- else
- curPlay = sensor.getPlayerData(nplay[a])
- end
- if not protected then
- for b=1, #curPlay["inventory"] do
- if curPlay["inventory"][b]["name"] ~= "empty" then
- print("Current Player: "..nplay[a])
- print("Name: "..curPlay["inventory"][b]["name"])
- print("Raw Name: "..curPlay["inventory"][b]["rawName"])
- print("Item ID: "..curPlay["inventory"][b]["id"])
- if curPlay["inventory"][b]["ench"][1] ~= nil then
- print("Enchantments:")
- for c=1, #curPlay["inventory"][b]["ench"] do
- print("["..c.."] "..curPlay["inventory"][b]["ench"][c])
- end
- end
- sleep(2)
- term.clear()
- term.setCursorPos(1, 1)
- else
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment