For loop not executing if statement in Java
I have created an infinite loop which clicks a "spin" button in an online game and I am waiting for the balance to be too low for the user to spin, in which the spin button becomes inaccessible. Everything is working smoothly until the spin button becomes inaccessible for the application to click, in which the code does not access the if statement but I'm not too sure why.
Here is my code:
So the screen click on the spinButton is looping here, and then I've added an if statement for when it becomes un-clickable (spinButton == null) - but however the if statement is not executed, the loop just keeps trying to look for the spinButton then eventually fails.
Could anyone possibly assist me with this and guide me in the right direction? Would be much appreciated.