I have been using 2 wait codes instead of the if loop. Wait for discon, counter +1, wait for reconn, go-to loop. This is blocking, so you obviously can't do anything else within the loop, like check multiple elements in one script. You would have to have separate scripts for each element.