Loop not looping (trying to click when color != something)

Get help with using AutoHotkey and its commands and hotkeys
SmolTurtle

Loop not looping (trying to click when color != something)

21 Jul 2018, 15:08

Hi everyone, i'm trying to click and hold somewhere and then click elsewhere when a color changes but do nothing when the color stays the same and i want it to keep trying ever X seconds until i stop it with a hotkey or anything, here's my code:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



This code does its job well but only once and doesn't loop at all
SmolTurtle

Re: Loop not looping (trying to click when color != something)

21 Jul 2018, 15:31

Update on this:

I deleted the "return" which was obviously getting me out of my loop and now it loops well until the color goes back to 0x545160, when it does so, it stops looping, so basically it still works only once when it manages to do its job here's my new code:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

User avatar
gregster
Posts: 1349
Joined: 30 Sep 2013, 06:48

Re: Loop not looping (trying to click when color != something)

21 Jul 2018, 16:12

This code has some flaws. Send ^q is unreachable. F2::Break doesn't do what you intend - well, the return inside the loop ends it anyway after the first iteration.

I assume, this will be closer to your goal:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Edited
SmolTurtle

Re: Loop not looping (trying to click when color != something)

21 Jul 2018, 16:24

Thanks a ton, works exactly as I wanted, i figured out by myself that the return was badly placed but didn't think of using a while

Return to “Ask For Help”

Who is online

Users browsing this forum: lukeman3000 and 44 guests