Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --NanoGlasses Version 2.0
- rednet.open("back")
- sensor=peripheral.wrap("right")
- glasses=peripheral.wrap("left")
- glassesController="darkbobo00"
- local pcX=-908
- local pcZ=-1835
- local pcY=84
- blackList={
- ["Doc_Jason"]=true,
- ["iTzBruin"]=true,
- }
- whiteList={
- ['darkbobo00']=true,
- ['dark_sjoerd']=true,
- ['Lekkerdie']=true,
- ['mastersnake20']=true,
- ['skye333']=true,
- }
- local distances={}
- weaponIDs={[23557]=true,[23559]=true,[23561]=true,[23563]=true,[23565]=true,[23567]=true,[23569]=true,[23587]=true,[23589]=true,[23590]=true,[23592]=true,[23594]=true,[23597]=true,[23617]=true,[23619]=true,[23621]=true,[23623]=true,[23625]=true,[23627]=true,
- [23629]=true,[23631]=true,[23647]=true,[23649]=true,[23651]=true,[23652]=true,[23667]=true,[23668]=true,[23670]=true,[23672]=true,[23674]=true,[23801]=true,[23803]=true,[23805]=true,[23807]=true,[23809]=true,[23811]=true,[23813]=true,[23815]=true,[23817]=true,
- [23819]=true,[23821]=true,[23823]=true,[23825]=true,[23827]=true,[23829]=true,[23831]=true,[23833]=true,[23835]=true,[23837]=true,[23839]=true,[23841]=true,[23843]=true,[23845]=true,[23847]=true,[23848]=true,[23850]=true}
- weaponNames={"sword","rapier","bow","paxel"}
- function getWeapons(playerName)
- allSlots=sensor.getPlayerData(playerName)['inventory']
- weapons={}
- for id,data in pairs(allSlots) do
- if weaponIDs[data['id']] then
- weapons[data['id']]=true
- else
- loweredString=string.lower(data['name'])
- for id,name in pairs(weaponNames) do
- if string.find(loweredString,name)~=nil then
- weapons[data['id']]=true
- end
- end
- end
- end
- return weapons
- end
- function isHacked()
- users=glasses.getUsers()
- for id,player in ipairs(users) do
- if player~=glassesController then
- return true
- end
- end
- return false
- end
- while true do
- data=sensor.getPlayerData(glassesController)
- if data~=nil and not isHacked() then
- playerX=data['position']['x']+pcX
- playerZ=data['position']['z']+pcZ
- playerY=data['position']['y']+pcY
- print(glassesController.." : "..playerX..","..playerZ..","..playerY)
- for name,__ in pairs(blackList) do
- data=sensor.getPlayerData(name)
- if data~=nil then
- local pos=data['position']
- local x=pos['x']
- local z=pos['z']
- local y=pos['y']
- local health=data['health']
- x=math.floor(pcX+x+0.5)
- z=math.floor(pcZ+z+0.5)
- y=math.floor(pcY+y+0.5)
- distance=math.floor(math.sqrt((x-playerX)^2+(z-playerZ)^2)+0.5)
- distances[name]={['x']=x,['z']=z,['y']=y,['d']=distance,['h']=health}
- print(name.." : "..x..","..z..","..y..","..distance)
- end
- end
- for name,__ in pairs(whiteList) do
- data=sensor.getPlayerData(name)
- if data~=nil then
- local pos=data['position']
- local x=pos['x']
- local z=pos['z']
- local y=pos['y']
- local health=data['health']
- x=math.floor(pcX+x+0.5)
- z=math.floor(pcZ+z+0.5)
- y=math.floor(pcY+y+0.5)
- distance=math.floor(math.sqrt((x-playerX)^2+(z-playerZ)^2)+0.5)
- distances[name]={['x']=x,['z']=z,['y']=y,['d']=distance,['h']=health}
- print(name.." : "..x..","..z..","..y..","..distance)
- end
- end
- local nameIndex=1
- glasses.clear()
- for name,information in pairs(distances) do
- local x=information['x']
- local z=information['z']
- local height=information['y']
- local distance=information['d']
- local health=information['h']
- if whiteList[name] then
- glasses.addText(5,nameIndex*10-5,name..":"..x..","..z.." Height :"..height.." Distance :"..distance.." Health:"..health,50000)
- elseif blackList[name] then
- glasses.addText(5,nameIndex*10-5,name..":"..x..","..z.." Height :"..height.." Distance :"..distance.." Health:"..health,8000000)
- end
- --stringLength=glasses.getStringWidth(name..": "..x..","..z.." Distance :"..distance)
- glasses.addBox(0,nameIndex*10-5,400,10,10000000,0.2)
- name=string.sub(name,1,6)
- nameIndex=nameIndex+1
- end
- else
- glasses.clear()
- glasses.addText(5,5*10,"DAFUQ R U DOIN",8000000)
- end
- event,message,a2,a3,a4=os.pullEvent()
- if event=="chat_command" then
- if message=="" then
- else
- local data=sensor.getPlayerData(message)
- armorIndex=0
- if data~=nil then
- armor=data['armor']
- glasses.clear()
- for armorSlot,data in pairs(armor) do
- glasses.addIcon(10,armorIndex*40+20,data['id'],0)
- armorIndex=armorIndex+1
- end
- weaponIndex=0
- collumnIndex=0
- weapons=getWeapons(message)
- for id,data in pairs(weapons) do
- glasses.addIcon(30+collumnIndex*20,weaponIndex*40+20,id,0)
- weaponIndex=weaponIndex+1
- if weaponIndex==4 then
- collumnIndex=collumnIndex+1
- weaponIndex=0
- end
- end
- inventoryIndex=0
- collumnIndex=0
- inventory=data['inventory']
- for slot,data in pairs(inventory) do
- if slot<37 and data~="empty" then
- glasses.addIcon(100+collumnIndex*20+100,inventoryIndex*40+20,data['id'],0)
- if data~="empty" then
- inventoryIndex=inventoryIndex+1
- if inventoryIndex==4 then
- collumnIndex=collumnIndex+1
- inventoryIndex=0
- end
- end
- end
- end
- sleep(5)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement