Script to work alongside Windows Task Scheduler

Ask gaming related questions (AHK v1.1 and older)
raposa95
Posts: 1
Joined: 01 Apr 2017, 10:13

Script to work alongside Windows Task Scheduler

01 Apr 2017, 10:30

Hello! I am extremely new so please bear with me if my questions are too simple. I did my part reading about #WinActive and similar articles, including related questions from other AHK users, but nothing truly solved my issue so I'll go ahead and ask you all. :D

Very well, so I play on a private WoW server which gets waaaay too crowded during afternoons(my timezone) and forces me to go through a 1000+ queue in order to play. To avoid that I simply log on in the morning and leave the game open. Problem is, I can't always do that on my own! I work at night, so the server starts to open slots just as I am about to leave my house. Sad, I know. :[


I will tell my Windows Task Scheduler to automatically run WoW.exe every day at 10:00 AM. I will leave an AHK script open 24/7(since I don't turn off my computer at all) and need a specific code to detect that Wow.exe has been executed and send an input, in that case my password, then press enter. Basically the script is supposed to do that every time Wow.exe is executed.


So far I've tried this:

Code: Select all

#IfWinActive ahk_exe Wow.exe

sleep, 5000
Send PASSWORD{enter}

I know that it's extremely simple. It doesn't work properly, too.

So, according to what I said above, how could I make this code understand its purpose? Also, if you know a say better alternative to get these things done, for instance doing it all with AHK only, let me know.
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Script to work alongside Windows Task Scheduler

17 Apr 2017, 10:11

AHK is more than capable of determining the current time and running programs, so you could do everything with an AHK script. I don't play WoW, so this might need some tweaking, but:

Code: Select all

#Persistent		; The script will run constantly even though it doesn't have any hotkeys
SetTimer, RunWow, 3600000	; RunWow will activate once per hour

RunWow:
if (A_Hour == 10)	; The following code will run only if it is currently between 10 and 11
{
	Run, Wow.exe, C:\Program Files\World of Warcraft\	; Change the directory here to your WoW install location
	Sleep, 5000		; Adjust this sleep to however long it takes for Wow to be at the password screen
	Send PASSWORD{enter}
}
return
Note that in general that code will trigger the same minute of the hour as when you start the script (so if you start it at 3:15 then it will try to run WoW at 10:15).

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 53 guests