I wrote some code for starting scripts when Axem launches. It will save the checked scripts to the .ini file, when Axem is reloaded it will read the .ini file and restart all of the scripts that were running before.
I didn't have much time to test it so let me know what you think :D
I'd like to add functionality to close the running subroutines when you exit Axem, didn't have time to get to this this morning.
Add "GoSub, RunStartup" after "GoSub, ShowWindow"
Add the RunStartup subroutine...
RunStartup:
;--- StartupScripts ---
;--- loops through the array and starts scripts if they are found ---
Loop %StartupScriptsCount% {
scriptText = % StartupScripts%A_Index%
; --- search through list to find matches ---
Loop % LV_GetCount() {
LV_GetText(RetrievedText, A_Index)
If InStr
(RetrievedText
, scriptText
) { LV_Modify(A_Index, "Check") ; Check each row whose first field contains the filter-text.
}
}
}
Add the following code to the "READINI" subroutine...
;--- StartupScripts ---
StartupScriptsCount = 0
;loop through ini and read in scripts
Loop {
StartupScriptsCount += 1
IniRead, StartupScripts
%StartupScriptsCount%
, %IniFile%
, Startup
, %A_Index%
, -1 If StartupScripts
%StartupScriptsCount%
= -1 }
And add the following code to the "WRITEINI" subroutine...
;--- StartupScripts ---
IniDelete, %IniFile%
, Startup
;clear section to rewrite ;--- create array with script text of all checked scripts ---
StartupScriptsCount = 0
Loop {
RowNumber := LV_GetNext(RowNumber, "Checked") ; Resume the search at the row after that found by the previous iteration.
if not RowNumber
; The above returned zero, so there are no more selected rows. LV_GetText(Text, RowNumber)
StartupScriptsCount += 1
StartupScripts%StartupScriptsCount% = %Text%
}
;--- loop through scripts and write list to ini file ---
Loop %StartupScriptsCount% {
scriptText = % StartupScripts%A_Index%
IniWrite, %scriptText%
, %IniFile%
, Startup
, %A_Index%
}