Loop / Cleaner code

Get help with using AutoHotkey and its commands and hotkeys
iHuggles
Posts: 6
Joined: 14 Nov 2017, 14:44

Loop / Cleaner code

14 Nov 2017, 14:56

Originally I was doing this and it was just really messy and I did not like the look at it.

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



Then I tried doing this

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



Im not a huge coder and I have read the Loop page. I just dont understand how to make a command like D Down and D up repeat a couple times without spamming the same command over and over again and then continue onto another set of commands I have told it to do like A down > A Up. Any help would be amazing! I have been messing around with it for a couple hours just cant seem to get it.
User avatar
Exaskryz
Posts: 2687
Joined: 17 Oct 2015, 20:28

Re: Loop / Cleaner code

14 Nov 2017, 15:00

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



The block is the group of commands wrapped inside the braces { }. This is what signals to the command above that if it's a flow-control command like If or Loop that all of these commands are a part of it.

Edit, but in this case, you might be able to avoid the Sleep commands by using SetKeyDelay. Could save a few lines of code, but what I had above should work. It is untested though.
iHuggles
Posts: 6
Joined: 14 Nov 2017, 14:44

Re: Loop / Cleaner code

14 Nov 2017, 15:04

Awesome! Its working great! The Capital D would explain why it would shift. Thanks so much!
iHuggles
Posts: 6
Joined: 14 Nov 2017, 14:44

Re: Loop / Cleaner code

14 Nov 2017, 15:05

Awesome! Its working great! The Capital D would explain why it would shift. Thanks so much!
iHuggles
Posts: 6
Joined: 14 Nov 2017, 14:44

Re: Loop / Cleaner code

14 Nov 2017, 15:05

Awesome! Its working great! The Capital D would explain why it would shift. Thanks so much!
iHuggles
Posts: 6
Joined: 14 Nov 2017, 14:44

Re: Loop / Cleaner code

14 Nov 2017, 15:05

Awesome! Its working great! The Capital D would explain why it would shift. Thanks so much!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], jinches1118 and 51 guests