Advertisement
NanoBob

(old) NanoGlasses

Sep 24th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.71 KB | None | 0 0
  1. blackList={
  2. ["Doc_Jason"]=true,
  3. ["iTzBruin"]=true,
  4. }
  5. whiteList={
  6. ['darkbobo00']=true,
  7. ['dark_sjoerd']=true,
  8. ['Lekkerdie']=true,
  9. ['mastersnake20']=true,
  10. ['skye333']=true,
  11. }
  12.  
  13. glassesController="darkbobo00"
  14. local distances={}
  15. sensor=peripheral.wrap("right")
  16. glasses=peripheral.wrap("left")
  17. local pcX=-908
  18. local pcZ=-1835
  19. local pcY=84
  20.  
  21.  
  22. function isHacked()
  23.     users=glasses.getUsers()
  24.     for id,player in ipairs(users) do
  25.         if player~=glassesController then
  26.             return true
  27.         end
  28.     end
  29.     return false
  30. end
  31.  
  32.  
  33. while true do
  34.     data=sensor.getPlayerData(glassesController)
  35.     if data~=nil and not isHacked() then
  36.         playerX=data['position']['x']+pcX
  37.         playerZ=data['position']['z']+pcZ
  38.         playerY=data['position']['y']+pcY
  39.         print(glassesController.." : "..playerX..","..playerZ..","..playerY)
  40.         for name,__ in pairs(blackList) do
  41.             data=sensor.getPlayerData(name)
  42.             if data~=nil then
  43.                 local pos=data['position']
  44.                 local x=pos['x']
  45.                 local z=pos['z']
  46.                 local y=pos['y']
  47.                 local health=data['health']
  48.                 x=math.floor(pcX+x+0.5)
  49.                 z=math.floor(pcZ+z+0.5)
  50.                 y=math.floor(pcY+y+0.5)
  51.                 distance=math.floor(math.sqrt((x-playerX)^2+(z-playerZ)^2)+0.5)
  52.                 distances[name]={['x']=x,['z']=z,['y']=y,['d']=distance,['h']=health}
  53.                 print(name.." : "..x..","..z..","..y..","..distance)
  54.                 end
  55.             end
  56.         for name,__ in pairs(whiteList) do
  57.             data=sensor.getPlayerData(name)
  58.             if data~=nil then
  59.                 local pos=data['position']
  60.                 local x=pos['x']
  61.                 local z=pos['z']
  62.                 local y=pos['y']
  63.                 local health=data['health']
  64.                 x=math.floor(pcX+x+0.5)
  65.                 z=math.floor(pcZ+z+0.5)
  66.                 y=math.floor(pcY+y+0.5)
  67.                 distance=math.floor(math.sqrt((x-playerX)^2+(z-playerZ)^2)+0.5)
  68.                 distances[name]={['x']=x,['z']=z,['y']=y,['d']=distance,['h']=health}
  69.                 print(name.." : "..x..","..z..","..y..","..distance)
  70.             end
  71.         end
  72.         local nameIndex=1
  73.         glasses.clear()
  74.         for name,information in pairs(distances) do
  75.             local x=information['x']
  76.             local z=information['z']
  77.             local height=information['y']
  78.             local distance=information['d']
  79.             local health=information['h']
  80.             if whiteList[name] then
  81.                 glasses.addText(5,nameIndex*10-5,name..":"..x..","..z.." Height :"..height.."  Distance :"..distance.." Health:"..health,50000)
  82.             elseif blackList[name] then
  83.                 glasses.addText(5,nameIndex*10-5,name..":"..x..","..z.." Height :"..height.."  Distance :"..distance.." Health:"..health,8000000)
  84.             end
  85.             --stringLength=glasses.getStringWidth(name..": "..x..","..z.."  Distance :"..distance)
  86.             glasses.addBox(0,nameIndex*10-5,400,10,10000000,0.2)
  87.             name=string.sub(name,1,6)
  88.             nameIndex=nameIndex+1
  89.         end
  90.     else
  91.         glasses.clear()
  92.         glasses.addText(5,5*10,"DAFUQ R U DOIN",8000000)
  93.     end
  94.       sleep(2)
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement