Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Only works with advanced peripherals
- -- Needs the Geo Scanner peripheral
- local geo = peripheral.wrap("back")
- print("looking for:")
- local query = read()
- function Search()
- while(true) do
- local scan = geo.scan(16)
- if (scan~=nil) then
- term.setBackgroundColor(colors.white)
- term.clear()
- paintutils.drawPixel(13,10,colors.black)
- for i, block_data in ipairs(scan) do
- if (string.find(block_data.name, query) <> nil) then
- PaintOre(block_data.x, block_data.y, block_data.z, colors.cyan)
- end
- end
- end
- sleep(0.1)
- end
- end
- function PaintOre(x,y,z,col)
- -- block position
- paintutils.drawPixel(x+13,z+10,col)
- term.setCursorPos(x+13,z+10)
- term.write(y)
- end
- -- Main --
- Search()
Advertisement
Add Comment
Please, Sign In to add comment