Hi
@swagfag. Thanks for the explanation!.
I'm new to Autohotkey and I'm learning, and I started using SetTimer for repetitions, but as I increased my script, I realized I needed to create an independent loop, that's when I met Autohotkey.dll
With this I needed to learn new functions and adapt, but my program was almost finished, with 7k+ lines, so to not have to redo everything from scratch, I'm having to use v1 with this adaptation to Autohotkey.dll where I can create these simultaneous processes and independently.
I have a loop with 75857 characters that needs to be run inside the AhkThread()
Edit:
I made some changes to the code and it looks like it now works fine. But I have not yet tested with my entire script inside the partitions, the test I did was with set of letters and numbers.
I noticed that it raises an error when it exceeds 16,383 characters and is inside a MsgBox (I'll leave the error example just below).
This test works very well now:
Code: Select all
Gui, +AlwaysOnTop
Gui, Add, Edit, r1 ReadOnly w200 vAlert, Stopped!
Gui, Add, Button, vStartScript gStartG, START!
Gui, Show,
return
toggle := 0
StartG:
toggle := !toggle
if (toggle) {
GuiControl,,StartScript, STOP!
GuiControl,,Alert, Running!
CritObj := CriticalObject({"variable1": "10:"})
script:="
("
15000 characters
)"
script.="
("
+15000 characters
)"
script.="
("
+15000 characters
)"
script.="
("
+15000 characters
)"
DllOn:=AhkThread(script,&CritObj)
FileAppend, %script%, C:\countcheck.txt
} else {
DllOn.ahkTerminate.1
GuiControl,,Alert, Stopped!
GuiControl,,StartScript, START!
}
return
Esc::ExitApp
GuiClose:
ExitApp
Here displays error in MsgBox when it exceeds the character limit, but saves the file with all the characters::
Code: Select all
Gui, +AlwaysOnTop
Gui, Add, Edit, r1 ReadOnly w200 vAlert, Stopped!
Gui, Add, Button, vStartScript gStartG, START!
Gui, Show,
return
toggle := 0
StartG:
toggle := !toggle
if (toggle) {
GuiControl,,StartScript, STOP!
GuiControl,,Alert, Running!
CritObj := CriticalObject({"variable1": "10:"})
script:="
("
MsgBox, 15000 characters
)"
script.="
("
+15000 characters
)"
script.="
("
+15000 characters
)"
script.="
("
+15000 characters
)"
DllOn:=AhkThread(script,&CritObj)
FileAppend, %script%, C:\countcheck.txt
} else {
DllOn.ahkTerminate.1
GuiControl,,Alert, Stopped!
GuiControl,,StartScript, START!
}
return
Esc::ExitApp
GuiClose:
ExitApp
- Screenshot_7.png (5.06 KiB) Viewed 5770 times