Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner = peripheral.wrap("back")
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- Blocks, Err = Scanner.scan(16)
- Found = false
- for id, block in pairs(Blocks) do
- if string.match(block["name"], "allthemodium") then
- Found = true
- term.setTextColor(colors.green)
- term.write(block["name"])
- term.setTextColor(colors.white)
- term.write(" at ")
- term.setTextColor(colors.blue)
- print(string.format("x:%d z:%d y:%d", block["x"], block["z"], block["y"]))
- local x = block["x"]
- local y = block["z"]
- local len = math.sqrt(math.pow(x,2) + math.pow(y,2))
- x = x / len
- y = y / len
- print(string.format("x:%d z:%d", x, y))
- end
- end
- if not Found then
- print(os.clock())
- print("Nothing found")
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement