Page 1 of 1

Sending keys is being repeated

Posted: 18 Jun 2017, 17:00
by karizma420
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%

Re: Sending keys is being repeated

Posted: 19 Jun 2017, 02:14
by O120D6a
That's not working?

Code: Select all

Numpad1::send {Enter}/joinme nick{Enter}

Re: Sending keys is being repeated

Posted: 19 Jun 2017, 05:47
by evilC

Code: Select all

WinGet, l, list, ahk_exe Trove.exe
send {Enter}/joinme Pandaface64


{

if (a_index > 1)
{
d := l%a_index%
WinGet, p, PID, ahk_id %d%
WinActivate, ahk_pid %p%
MouseClick, left, %AcceptX%, %AcceptY%, ,4
}
}
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.

Re: Sending keys is being repeated

Posted: 19 Jun 2017, 19:25
by karizma420
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