Sending keys is being repeated

Get help with using AutoHotkey and its commands and hotkeys
karizma420
Posts: 2
Joined: 18 Jun 2017, 16:54

Sending keys is being repeated

18 Jun 2017, 17:00

Im trying to get the script to type /joinme Pandaface64 and press enter but it does it twice. also, it presses enter at the end even when i dont have that in the script.

Script Below:

Numpad0::
ExitApp
Numpad1::
AcceptX = 378
AcceptY = 363
CoordMode, Mouse, Window
WinGet, l, list, ahk_exe Trove.exe
send {Enter}/joinme Pandaface64
Loop %l%
{

if (a_index > 1)
{
d := l%a_index%
WinGet, p, PID, ahk_id %d%
WinActivate, ahk_pid %p%
MouseClick, left, %AcceptX%, %AcceptY%, ,4
}
}

WinGet, p, PID, ahk_id %l1%
WinActivate, ahk_pid %p%
Last edited by karizma420 on 19 Jun 2017, 19:29, edited 2 times in total.
O120D6a

Re: Sending keys is being repeated

19 Jun 2017, 02:14

That's not working?

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

Numpad1::send {Enter}/joinme nick{Enter}
User avatar
evilC
Posts: 3294
Joined: 27 Feb 2014, 12:30

Re: Sending keys is being repeated

19 Jun 2017, 05:47

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


WinGet, l, list, ahk_exe Trove.exe
Get a list of windows, store it in l

send {Enter}/joinme Pandaface64
Send the keys to the active window - why do this straight after getting a list of windows?

if (a_index > 1)
You have no loop.
A_Index will never hold any value.
karizma420
Posts: 2
Joined: 18 Jun 2017, 16:54

Re: Sending keys is being repeated

19 Jun 2017, 19:25

added the loop, it was originaly in there but i mustve accidentally deleted it.

The script itself works, But when it sends {enter}/joinme "name" It sends it twice. It sends the original chat command, then reapeats but not in a chatbox causing all sorts of hotkeys to be pressed, such as the pause menu, store, etc. and i cant figure out whats causing it to be sent multiple times.

and i send the keys to the active windows after getting a list because it needs to type it in the currently active window, then switches to the background windows to click accept

Return to “Ask For Help”

Who is online

Users browsing this forum: cjs, divanebaba, Exaskryz, iceivanov, L40P and 25 guests