AKP 1.9 Sourcecode
AKP 1.9 Sourcecode
au3>
#include <Array.au3> ;For Array storage
#include <GUIConstantsEx.au3> ;For GUI display
#include <EditConstants.au3> ;Allows positioning of gui input box text
#include <StaticConstants.au3> ;Allows formatting of gui labels
;#include <Sleep2.au3> ;For allowing GUI to still function while the delay is
happening
#include <GuiListView.au3> ;For making the clear listview function work
#include <Restart.au3>
#Include <HotKeyRecording5.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
#include <File.au3>
Global $Play = GUICTRLCREATELabel("Play Hotkey:", 170, 5, 110, 20) ;The play button
Global $Play2 = GUICtrlCREATECombo("Select", 170, 22, 80, 30)
GUICtrlSetData($Play2, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|NUMPAD1|NUMPAD2|
NUMPAD3|NUMPAD4|NUMPAD5|NUMPAD6|NUMPAD7|NUMPAD8|NUMPAD9|NUMPAD0|SPACE")
Global $Set2 = GUICtrlCreateButton("Set", 255, 22, 40, 20)
Global $Input = GUICTRLCREATEInput("500", 316, 70, 60, 20, $ES_CENTER) ;The timer
input box
GUICtrlCreateUpdown($Input)
Global $InputLabel1 = GUICTRLCREATELabel("milliseconds", 386, 73, 60,
20) ;milliseconds label
Global $InputLabel2 = GUICTRLCREATELabel("Time between presses", 328, 52, 110,
15) ;time between presses label
Global $InputLabel3 = GUICTRLCREATELabel("", 310, 50, 143, 50,
$SS_ETCHEDFRAME) ;Frame around timer input options
Global $run = 0 ;Makes it so that the program isn't recording when you first open
it
Global $play1 = 0 ;Makes it so that the program isn't playing back recording when
you first open it
Global $play1edit = 0 ;Makes it so that the program isn't play back the edited
script recording
Global $Numberoflines = 0
Global $b = 1
Global $x
Global $u
Global $Hotkey1 = 1
Global $Hotkey2 = 2
Global $SkippedStop = 0
Global $Repeat = 1
Global $EditEnable = 1;0!here!
Global $Trial = 1
Global $Timepressed;;;;;;;;;;;;;;;;;;;;;;;;
Global $DontRepeat = 0
Global $ChangesApplied = 0
Global $makeitup = 0
Global $EditPressed = 0
Global $FileLoad1
If $30DayChecker Then
$30DaysAhead = _DateAdd ( 'd', 31, FileReadLine($rFilePath2, 1)) ;Add 30 days to
the day when program was first opened
Local $TimeRemaining = _DateDiff( 'd', _NowCalc(), $30DaysAhead) ;Add 30 days to
when you first opened the program
If $FullVersion <> "FULL" Then ;If the full version has never been opened on the
computer
Global $Trial = 0
Msgbox(0,"Trial Expired", "Sorry! But your trial of this program has ended, please
purchase the full version for just $5. Click the Get Full Version button!")
GUICtrlSetState ( $TimeLeftLabel1, $GUI_Hide)
Global $TimeLeftLabel3 = GUICTRLCREATELabel("Your trial has ended!", 30, 242, 140,
15) ;time between presses label
EndIf
EndIf
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func Start()
If $Trial = 1 Then
Sleep(400)
_GUICtrlListView_DeleteAllItems($KeyboardInfo)
Global $avvArray[$a]
Global $timeArray[$x]
Global $pauseArray[$u]
Global $a = 1;!here!!new!
Sleep(200)
$SplashX = 0
$SplashY = 3
$Splashmessage = ""
$Splashmessage1 = "Start pressing in " & $Splashmessage
SplashTextOn("Autosofted", $Splashmessage, 180, 50, -1, -1, 4, "", 15)
While $SplashY > $SplashX
$Splashmessage = $SplashY & @LF
ControlSetText("Autosofted", "", "Static1", $Splashmessage1 & $Splashmessage)
sleep(1000)
$SplashY = $SplashY - 1
WEnd
ControlSetText("Autosofted", "", "Static1", "PRESS!")
Sleep(300)
WinSetState("Autosofted","",@SW_Hide)
EndIf
EndIf
EndFunc
Func Stop() ;Stops Keyrecording
Sleep(400)
TrayTip("Stop", "Recording Done! Press "&$Hotkey2&" to play key presses.", 0)
$EditEnable = 1
GUICtrlSetState($EditScript, $GUI_ENABLE)
$run = 0 ;Makes it so that you can't add anymore keys to the array
;If $EditPressed = 1 Then;
;$a = $b ;Start the script all
over;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Else;
$b = $a ;B will be used to store the value of the array when it's at
it's largest size after the recording is done
;EndIf;
Global $InputLabelStatus2 = GUICTRLCREATELabel("Press "&$Hotkey2&" to play
key presses.", 85, 260, 350, 25) ;time between presses label
GUICtrlSetFont ( $InputLabelStatus2, 11, 620 )
HotKeySet($HotKey11, "Start")
EndFunc
Func Play()
If $Trial = 1 Then
GUICtrlSetState($EditScript, $GUI_DISABLE)
Sleep(400)
;if applied changs have been done, then for blah = numberoflines, minus
1 row
Sleep(1000)
HotKeySet($HotKey22, "Play")
GUICtrlSetState($EditScript, $GUI_ENABLE)
Global $InputLabelStatus2 = GUICTRLCREATELabel("Script paused. Press
"&$HotKey2&" to unpause or "&$HotKey1&" to clear script.", 85, 260, 400, 35) ;time
between presses label
GUICtrlSetFont ( $InputLabelStatus2, 11, 620 )
HotKeySet($HotKey11, "End")
EndFunc
Func End()
SaveHotKey()
_ScriptRestart()
EndFunc
Func SaveHotKey()
Local $gFileOpen = FileOpen($rFilePath, 2) ;Creates a text file (2 at the end
makes it so that the file is re-created everytime)
FileWrite($gFileOpen, "Start/Stop Hotkey: "&$HotKey11& @CRLF) ;Write the set
hotkey to the text file
FileWrite($gFileOpen, "Play Hotkey: "&$HotKey22& @CRLF) ;Write the set hotkey
to the text file
$TimerCheck = GUICtrlRead($Input)
FileWrite($gFileOpen, "Timer: "&$TimerCheck& @CRLF) ;Write the set hotkey to
the text file
EndFunc
;/////////////////////// SAVE
FUNCTION///////////////////////////////////////////
Func Save()
; Create a constant variable in Local scope of the message to display in
FileSaveDialog.
Local Const $sMessage = "Choose a filename."
Global $CtrlShiftAlt
_ArrayInsert($avvArray, 0, $EditedLoadKey4)
$a = $a + 1
_ArrayInsert($timeArray, 0, $EditedLoadHold3)
$x = $x + 1
_ArrayInsert($pauseArray, 0, $EditedLoadTime3)
$u = $u + 1
WinClose("Script Editor")
msgbox(0,"Success!", "Script Loaded! Press "&$HotKey2&" to
play.")
EndIf
EndIf
EndFunc ;==>Example
;//////////////////////////////////////////////////////////////////////////////////
//////
$Hotkey1 = $OpeningBracket1
GUICtrlSetData($Start2, $Hotkey1)
EndIf
While 1
Sleep(10)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Cases;;;;;;;;;;;;;;;;;;;;;;;;;;;
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE ;If the "x" button on the GUI is clicked then
exit while loop (which will lead to the last line of code which tells GUI to close)
SaveHotKey()
ExitLoop
Case $Exit ;If the exit button is pressed, then end the program
SaveHotKey()
ExitLoop
Case $BuyFull ;If the visit website button is clicked, then redirect to
autosofted.com
ShellExecute("http://www.autosofted.com/auto_keyboard_premium/")
Case $Clear
SaveHotKey()
_ScriptRestart()
Case $Set1 ;If the first set button is pressed then read what hotkey
was selected in the dropdown
$Hotkey1 = GUICtrlRead($Start2) ;Read item selected in first
dropdown menu
$Hotkey11 = "{"&$Hotkey1&"}" ;Add the { } so that the Hotkeyset
can read it properly
HotKeySet($HotKey11, "Start") ;Set it so that if you press the
selected hotkey, then it starts the recording
MsgBox(0, "Autosofted", "Start/Stop key has been set!", 0)
GUICtrlSetState($ApplyChanges,
$GUI_DISABLE)
GUICtrlSetState($LoadScript,
$GUI_DISABLE)
Sleep(750)
;WinClose("Script Editor")
msgbox(0,"Success!", "Changes were
saved, Press "&$Hotkey22&" to play the edited script.")
WinClose("Script Editor")
Global $Editor =
GUICtrlRead($ChildInput)
Case $SaveScript
Save()
Case $LoadScript
Load()
$a = 0;!here! !new!
Case $CloseChild
;GUICtrlSetState($EditScript,
$GUI_DISABLE)
GUICtrlSetState($ApplyChanges,
$GUI_DISABLE)
ExitLoop
Case $GUI_EVENT_CLOSE ;If the "x" button
on the GUI is clicked then exit while loop (which will lead to the last line of
code which tells GUI to close)
;GUICtrlSetState($EditScript,
$GUI_DISABLE)
GUICtrlSetState($ApplyChanges,
$GUI_DISABLE)
ExitLoop
EndSwitch
$NumberofLines = $NumberofLines + 1
EndIf
If $run = 1 and $SkippedStop = 1 Then ;If you pressed run without pressing
stop after playing then restart script
MsgBox(0,"Autosofted","Error: You have selected to Play without a full
recording. Please make sure you Start AND Stop a recording before Playing")
_ScriptRestart()
EndIf
If $run = 1 Then ;If Start has been pressed then start recording keystrokes
Sleep(10)
_KeyRecord()
If $CtrlCheck = 1 Then;
$timeArray[$x - 1] = 0
EndIf;
;//////////////////////////////////////////////////////////////////////
//////////////
If $AltCheck = 1 Then;
$timeArray[$x - 1] = 0
EndIf;
;//////////////////////////////////////////////////////////////////////
//////////////
If $ShiftCheck = 1 Then;
$timeArray[$x - 1] = 0
EndIf;
;//////////////////////////////////////////////////////////////////////
//////////////
If $BracketCheck11 = 1 Then;
$BracketCheck33 = StringMid($avvArray[$a - 1],
$BracketCheck11+1, $BracketCheck22- $BracketCheck11 - 1);
While TimerDiff($TimeStamp) < $timeArray[$x - 1] *
1000 ;While the timestamp is less than the time you held the key down for
Send("{" & $BracketCheck33 & " Down}") ;Hold Key down
WEnd
Send("{" & $BracketCheck33 & " Up}");Send key up
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;$Timer2 = GUICtrlRead($Input) ;This is the data inputted in the timer text box
of the GUI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;; Sleep($Timer2) ;Amount of time between each click as entered in by the
inputter
Sleep($pauseArray[$u - 1])
$a = $a - 1;;;;;;;;;;;;;;;;;;;;
$x = $x - 1;;;;;;;;;;;;;;;;;;;;
$u = $u - 1;;;;;;;;;;;;;;;;;;;;
Else;
While TimerDiff($TimeStamp) < $timeArray[$x - 1] *
1000 ;While the timestamp is less than the time you held the key down for
;//////////////////////////////////////NORMAL KEY
HOLD DOWN AND BACKUP/////////////////////////////////
Send("{" & $avvArray[$a - 1] & " Down}") ;Hold Key
down
WEnd
Send("{" & $avvArray[$a - 1] & " Up}");Send key up
;////////////////////////////////////////////////////
////////////////////////////////
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;$Timer2 = GUICtrlRead($Input) ;This is the data inputted in the timer text box
of the GUI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;; Sleep($Timer2) ;Amount of time between each click as entered in by the
inputter
Sleep($pauseArray[$u - 1])
$a = $a - 1;;;;;;;;;;;;;;;;;;;;
$x = $x - 1;;;;;;;;;;;;;;;;;;;;
$u = $u - 1;;;;;;;;;;;;;;;;;;
EndIf
EndIf;
;~ GUICtrlSetState($EditScript, $GUI_DISABLE)!here!
EndIf
If $a <> 0 and $play1 = 1 and $play1edit = 1 and $DontRepeat <> 1 Then ;If
the apply changes has been done then and you click on editor again and no script
got
loaded;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Global $avvArray ;redeclare to zero it CAUSE YOU WANT TO START FRESH
AND MAKE SCRIPT READ AND PLAYBACK ONLY THINGS FROM THE SCRIPT EDITOR AS IF NOTHING
ELSE HAPPENED BEFORE IT
;Global $timeArray ;redeclare to zero it
;Global $pauseArray ;reclare to zero it
For $Count = 1 to $NumberofLines
If $play1 = 1 Then
$Anomaly = StringInStr($Editor, "0 Pause")
If $Anomaly <> 0 Then
$BeforeAnomaly = StringMid($Editor, $Anomaly, 30)
$BeforeAnomaly2 = StringMid($Editor, $Anomaly-9, 17)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Global $CtrlShiftAlt2
If $CtrlCheck2 = 1 Then;
$EditedHold3 = 0
$EditedHold4 = 0
EndIf;
;//////////////////////////////////////////////////////////
//////////////////////////
;//////////////////////////////////////ALT CAN'T HOLD
DOWN/////////////////////////////////
$AltCheck2 = StringInStr($EditedKey33, "!", 0)
If $AltCheck2 = 1 Then;
$EditedHold3 = 0
$EditedHold4 = 0
EndIf;
;//////////////////////////////////////////////////////////
//////////////////////////
If $ShiftCheck2 = 1 Then;
$EditedHold3 = 0
$EditedHold4 = 0
EndIf;
;//////////////////////////////////////////////////////////
//////////////////////////
;_ArrayInsert($timeArray, 0, $EditedHold3)
_ArrayInsert($avvArray, 0, $EditedKey33)
_ArrayInsert($pauseArray, 0, $EditedTime3)
_ArrayInsert($timeArray, 0, $EditedHold3)
; If $Changesapplied = 1 Then; if u click apply
changes a second time
; Endif
;EndIf
$T_INIT = TimerInit()