Add count type to Agent check

It is written this way to skip the count when the counter is reset. e.g. 1, 2, 3, 0, 4 would give 3 using your suggested code, but the correct count should be 6 = (2-1)+(3-2)+(4-0).