paramus

Manual Geo Scanner

Aug 11th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Only works with advanced peripherals
  2. -- Needs the Geo Scanner peripheral
  3. local geo = peripheral.wrap("back")
  4.  
  5. print("looking for:")
  6. local query = read()
  7.  
  8. function Search()
  9.     while(true) do
  10.  
  11.         local scan = geo.scan(16)
  12.         if (scan~=nil) then
  13.             term.setBackgroundColor(colors.white)
  14.             term.clear()
  15.             paintutils.drawPixel(13,10,colors.black)
  16.             for i, block_data in ipairs(scan) do
  17.                 if (string.find(block_data.name, query) <> nil) then
  18.                     PaintOre(block_data.x, block_data.y, block_data.z, colors.cyan)
  19.                 end
  20.             end
  21.         end
  22.         sleep(0.1)
  23.     end
  24. end
  25.  
  26. function PaintOre(x,y,z,col)
  27.     -- block position
  28.     paintutils.drawPixel(x+13,z+10,col)
  29.     term.setCursorPos(x+13,z+10)
  30.     term.write(y)
  31. end
  32.  
  33. -- Main --
  34. Search()
Advertisement
Add Comment
Please, Sign In to add comment