m-mueller678

ore scanner

Jul 31st, 2021
1,001
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local debug=component.debug
  2. local world=debug.getWorld()
  3.  
  4. local px=debug.getX()
  5. local pz=debug.getZ()
  6.  
  7. local h_step=5
  8. local v_step=3
  9.  
  10. local h_range=300
  11. local y_max=120
  12.  
  13. function map_block_state(state)
  14.     return  state:match('^gregtech:ore_(%a*)')
  15. end
  16.  
  17. for x=px-h_range,px+h_range,h_step do
  18.     for z=pz-h_range,pz+h_range,h_step do
  19.         if not world.isLoaded(x,60,z) then continue end
  20.         for y=0,y_max,v_step do
  21.             local result=handle_block_state(world.getBlockState(x,y,z))
  22.             if result then
  23.                 print(x,y,z,result)
  24.             end
  25.         end
  26.     end
  27. end
RAW Paste Data