using pullstime

IanCrowe:
Much simpler than a whole pile of nested ifs.

Perhaps that's what this was going to be:

UKHeliBob:
Try that and get it working then I will suggest an even better way to do it

@IanCrowe, I think UKHeliBob has a plan here: he's walked this OP through a process for a couple of days now, and with all due respect to the OP, he (the OP) is struggling, and perhaps it would be better to leave UKHB to it....

(I've been here since #5, and just chipped in with parts where I saw errors, like the x%0 thing and the counting of releases not presses. Your suggestion is of course a very valid one, I just think it's best to let UKHB go with this... (imo, of course.))