Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require('component')
- local event = require('event')
- local keyboard=require('keyboard')
- local geo=com.geolyzer
- arg={...}
- rad=(tonumber(arg[1]) or 5)
- ef=(tonumber(arg[2]) or 2.8)
- targ={999,0,0,0,0}
- ores={
- {2.9,3.1,"iron/diamons/redstone"}
- }
- for x=-rad,rad do
- for z=-rad,rad do
- map=geo.scan(x,z)
- for y=-rad,rad do
- if map[y+32]>ef and map[y+32]<50 then
- local dist=(x^2+y^2+z^2)^0.5
- if targ[1]>dist then
- targ[1]=dist
- targ[2],targ[3],targ[4]=x,y,z
- targ[5]=map[y+32]
- end
- end
- end
- end
- end
- print("distances from ore:"..targ[1].." coords: X:"..targ[2].." Y:"..targ[3].." Z:"..targ[4].." density:"..targ[5])
- targ[1]=999
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement