Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- find = "Cave"
- m = peripheral.wrap("bottom")
- os.loadAPI("ocs/apis/sensor")
- local prox = sensor.wrap("right")
- while true do
- count=0
- m.clear()
- m.setCursorPos(1,1)
- m.write("Count")
- local targets = prox.getTargets()
- for name, details in pairs(targets) do
- if string.find(name,find) ~= nil then
- --gc=details.Position
- --print("y"..gc.Y)
- --print("x"..gc.X)
- --print("z"..gc.Z)
- count=count+1
- end
- end
- m.setCursorPos(2,2)
- m.write(count)
- m.setCursorPos(2,3)
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment