Last active
August 29, 2015 14:21
-
-
Save Lokno/c0532ce33760b01a28f7 to your computer and use it in GitHub Desktop.
Autohotkey script that captures all digits keys and pastes the last 22-digits of every 30-digit number typed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Captures all digits keys and pastes the last 22-digits of every 30-digit number typed | |
; Replaces clipboard with result | |
; Press the 'pause' key to suspend the script. Press it again to resume. | |
; Press home to reset state | |
numstr = | |
count := 0 | |
prefixLength := 8 | |
codeLength := 30 | |
Add( d ) | |
{ | |
global numstr | |
global count | |
global prefixLength | |
global codeLength | |
count := count + 1 | |
if( count > prefixLength ) | |
{ | |
numstr = %numstr%%d% | |
} | |
if( count == codeLength ) | |
{ | |
clipboard = %numstr% | |
count := 0 | |
numstr = | |
Send ^v | |
} | |
} | |
Pause::Suspend | |
Esc::ExitApp | |
$Home:: | |
numstr = | |
count := 0 | |
Send {Home} | |
return | |
0:: | |
Add( "0" ) | |
return | |
1:: | |
Add( "1" ) | |
return | |
2:: | |
Add( "2" ) | |
return | |
3:: | |
Add( "3" ) | |
return | |
4:: | |
Add( "4" ) | |
return | |
5:: | |
Add( "5" ) | |
return | |
6:: | |
Add( "6" ) | |
return | |
7:: | |
Add( "7" ) | |
return | |
8:: | |
Add( "8" ) | |
return | |
9:: | |
Add( "9" ) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment