Send a word every 2 hours to an application Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Send a word every 2 hours to an application

Post by Jenova » 26 May 2022, 14:12

Hello, ive looked far and wide and all i want is a script to send a word every 2 hours to an application. Does anyone have an idea of how to accomplish this? Thanks. :)
Last edited by BoBo on 26 May 2022, 14:32, edited 1 time in total.
Reason: Changed title from 'Simple script' to 'Send a word every 2 hours to an application' to be more specific.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Send a word every 2 hours to an application

Post by BoBo » 26 May 2022, 14:37

Code: Select all

#Persistent
SetTimer, spitAword, % 2*60*60*1000
Return

spitAword:
Send whatever word ; use ControlSend instead!
Return

Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Re: Send a word every 2 hours to an application

Post by Jenova » 27 May 2022, 21:51

BoBo wrote:
26 May 2022, 14:37

Code: Select all

#Persistent
SetTimer, spitAword, % 2*60*60*1000
Return

spitAword:
Send whatever word ; use ControlSend instead!
Return
replaced "whatever word" with my desired word and set it up and nothing happens. No idea if its even running or not. Sorry, i am new at this.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Send a word every 2 hours to an application

Post by BoBo » 27 May 2022, 23:38

Well, a 2h delay was your requirement. So being impatient wasn’t part of the plan, right? Right. ;)
For testing change % 2*60*60*1000 AKA (60x1000ms = 1m x 60 = 1h x 2 = 2h) to % 0.5*60*1000 ; 30sec so you’ll see the String is getting send every half a minute. HTH

Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Re: Send a word every 2 hours to an application

Post by Jenova » 27 May 2022, 23:53

BoBo wrote:
27 May 2022, 23:38
Well, a 2h delay was your requirement. So being impatient wasn’t part of the plan, right? Right. ;)
For testing change % 2*60*60*1000 AKA (60x1000ms = 1m x 60 = 1h x 2 = 2h) to % 0.5*60*1000 ; 30sec so you’ll see the String is getting send every half a minute. HTH
Sorry I had waited for over 2 hours and nothing had sent. I'll try this next.

Edit: Nope. Wont even send to Notepad.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Send a word every 2 hours to an application

Post by BoBo » 28 May 2022, 00:08

So, what's your target application? (Have you used ControlSend instead of Send, or have you used my code exactly as it is given here?)
Feel free to replace Send with SoundBeep for testing.

Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Re: Send a word every 2 hours to an application

Post by Jenova » 28 May 2022, 00:13

BoBo wrote:
28 May 2022, 00:08
So, what's your target application? (Have you used ControlSend instead of Send, or have you used my code exactly as it is given here?)
Elsword. I want to remind my guild teammates to do dailies every two hours. I tried ControlSend right before I sent the edit on Notepad. The cursor stops blinking until i click it again tho.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Send a word every 2 hours to an application

Post by BoBo » 28 May 2022, 00:29

Games responsiveness is different. You have to do some trial & error regarding the different flavor of Send-commands, the target controls focus setting etc.
If you use a SoundBeep instead of Send you'll "see" that there's no problem on the timing part of this script (check out AHK’s Help about SetTimer).

Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Re: Send a word every 2 hours to an application

Post by Jenova » 28 May 2022, 00:41

BoBo wrote:
28 May 2022, 00:29
Games responsiveness is different. You have to do some trial & error regarding the different flavor of Send-commands, the target controls focus setting etc.
If you use a SoundBeep instead of Send you'll "see" that there's no problem on the timing part of this script (check out AHK’s Help about SetTimer).
Even just using it on Notepad, nothing is sent or written so i dont know what is going on. Am i doing something wrong?

Jenova
Posts: 6
Joined: 26 May 2022, 14:10

Re: Send a word every 2 hours to an application  Topic is solved

Post by Jenova » 29 May 2022, 12:16

Jenova wrote:
28 May 2022, 00:41
BoBo wrote:
28 May 2022, 00:29
Games responsiveness is different. You have to do some trial & error regarding the different flavor of Send-commands, the target controls focus setting etc.
If you use a SoundBeep instead of Send you'll "see" that there's no problem on the timing part of this script (check out AHK’s Help about SetTimer).
Even just using it on Notepad, nothing is sent or written so i dont know what is going on. Am i doing something wrong?
Found a different application that makes it work.

Post Reply

Return to “Gaming Help (v1)”