I need help with complicated script

Get help with using AutoHotkey and its commands and hotkeys
wojtkanin1
Posts: 1
Joined: 22 Dec 2020, 13:35

I need help with complicated script

22 Dec 2020, 13:51

Hi, I am pretty new to AHK, however i read a lot about it. Some time ago I created few macros and scripts for gaming.

I am in progress of making my first complicated script and I need your help.
I want script to work like this:

FIRST PART

if color1 is red
click1
send1
sleep1
if color2 is black
RELOAD SCRIPT
else
CONTINUE TO SECOND PART
else if color1 is black
click2
send2
sleep2
if color2 is red
RELOAD SCRIPT
else
CONTINUE TO SECOND PART
else
RELOAD SCRIPT

Second part

Works basically as First part with some changes with click1, send1, sleep1, click2, send2, sleep2

Now, I don't need help with creating whole script, I just need to know what to do with:
- RELOAD SCRIPT - I don't want just "reload" command, I need the script to reload automatically and start automatically, to keep working when I am afk for example.
- CONTINUE TO SECOND PART - There will be approximately 10 parts so it's just example.



Thank You so much :)
User avatar
mikeyww
Posts: 5359
Joined: 09 Sep 2014, 18:38

Re: I need help with complicated script

22 Dec 2020, 14:13

IniWrite can be used to store information between runs. Alternatively, you could run the script with a command-line parameter, using a #SingleInstance.
RickC
Posts: 253
Joined: 27 Oct 2013, 08:32

Re: I need help with complicated script

24 Dec 2020, 09:05

In addition to the answer above by @mikeyww, you could use the Windows registry to store/retrieve data to save reading/writing to a seperate file.

I use the registry because I am more familiar with AHK's registry-related commands and haven't put the time into learning INI-related commands but, from what I read, either method will work fine.
User avatar
mikeyww
Posts: 5359
Joined: 09 Sep 2014, 18:38

Re: I need help with complicated script

24 Dec 2020, 09:35

Good point!

All of the methods work. In some cases, computer security settings can impair writing to the registry, but if not, then it can be convenient.

Return to “Ask For Help”

Who is online

Users browsing this forum: ark, Spawnova and 40 guests