boiler wrote: ↑06 Aug 2021, 18:25
I thought you said the letter T somewhere. Below is the code modified for the letter d. But it's not after you release the letter. It's after you press d and then a space or enter like I said. I didn't make it do the part where it sends the other stuff and wait for other digits. I was just trying to show how you can get it to do the recognizing the 6+ digits followed by a d. Other things can be added.
Code: Select all
:?B0:T::
ClipSave := ClipboardAll
Clipboard := ""
Send, +^{Left}^c^{Right}
Entry := Clipboard
Clipboard := ClipSave
if (Entry ~= "^\d{6,}d")
gosub, MyRoutine
return
MyRoutine:
LAlt & `::
MouseMove, 807, 360
MouseClick, left, 807, 360
Send, 1, {Tab}, 1
MouseClick, left, 535, 261
Send ^v ; this is preferred over ^{V}
SetKeyDelay, 1
MouseClick, left, 295, 260
MouseClick, left, 350, 440
return
Dear boiler, I'm sorry I stress you with that, but the code doesn't work.
Nothing happen after I type six digits follower by letter D not even after I press Enter.
The code should start something with :
as Mikey did earlier. But instead of 1103, wich are 4 digits, it should be six digits and not exactly 1103, could be any six digits, random digits (e.g 110033D , 322555D etc)
After D is pressed and released it should send {Tab 2} then wait for digits from 1 to 20 range (1,2,3 4, 5,... 11, 12... 20) to be pressed on numpad. Right after that should run the sub routine as you said.
Mikey's macro detect automatically the four digits 1103 and respectively 1105 and after that it continue with further commands.
I need a similar macro , detecting six digits, but should be aleatory these digits instead of fixed ones.
For example I have 3 clients, Bill, Will, Charlie
Bill have the code 123123D
Will have the code 321321D
Charlie have the code 112221D
Each of them has its unique identification code in database wich I will introduce from numpad .
So I will press on numpad for Bill 12123 and then the key D on keyboard and program will recognize the client, that is 123123D
After that, macro should continue with sending {Tab 2} and then wait for 2 digits sent from numpad again before continuing with execution of the subRoutine.