AutoClick Twice after receive input

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
navin6037
Posts: 2
Joined: 12 Aug 2022, 02:25

AutoClick Twice after receive input

Post by navin6037 » 12 Aug 2022, 02:30

as per picture, i tried to receive input then want mouse to auto click at Next twice.

For the Input, user will scan barcode that starts with number 9,

once system detect there's input 9, want to autoclick Next twice.

i tried copying and editing but cant work.

Code: Select all

~9::
if (A_PriorHotkey != "~9" or A_TimeSincePriorHotkey > 400000)
{
    ; Waiting for num 9 to be entered
    KeyWait, 9
    return
}


Click, 671 1064 Left

return
[Mod edit: [code][/code] tags added.]
Attachments
Screenshot_1.png
Screenshot_1.png (165.71 KiB) Viewed 513 times

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: AutoClick Twice after receive input

Post by mikeyww » 13 Aug 2022, 06:39

I do not have a barcoder, but you could try the following.

Code: Select all

~9::Click, 671 1064

navin6037
Posts: 2
Joined: 12 Aug 2022, 02:25

Re: AutoClick Twice after receive input

Post by navin6037 » 14 Aug 2022, 19:55

mikeyww wrote:
13 Aug 2022, 06:39
I do not have a barcoder, but you could try the following.

Code: Select all

~9::Click, 671 1064
It didn't work,

i found one post i copied and it worked after scanned, but the position of clicking not accurate.

Code: Select all

Loop 10
   Hotkey, % "$~" A_Index-1, BarCodeHandler
Hotkey,$~Enter,Test1
BarCodeHandler:
If (Accu && A_TimeSincePriorHotkey>60 && !Accu:="")
    Return
Accu .= SubStr(A_ThisHotkey, 0)
return
Test1:
Send % "{BS " (StrLen(accu)+1) "}"


If Accu
MouseClick, right, 210, 670
   Sleep 1000
MouseClick, right, 210, 670
accu:=""
return
[Mod edit: [code][/code] tags added.]
Attachments
Screenshot_2.png
Screenshot_2.png (40.96 KiB) Viewed 425 times

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: AutoClick Twice after receive input

Post by mikeyww » 14 Aug 2022, 20:37

Run Window Spy to check coordinates. As noted, default coordinates are relative to the active window.

Explained: CoordMode

Post Reply

Return to “Ask for Help (v1)”