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%
Sending keys is being repeated
-
- Posts: 2
- Joined: 18 Jun 2017, 16:54
Sending keys is being repeated
Last edited by karizma420 on 19 Jun 2017, 19:29, edited 2 times in total.
Re: Sending keys is being repeated
That's not working?
Code: Select all
Numpad1::send {Enter}/joinme nick{Enter}
Re: Sending keys is being repeated
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
}
}
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.
-
- Posts: 2
- Joined: 18 Jun 2017, 16:54
Re: Sending keys is being repeated
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
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