Continuation Section too long Topic is solved
Continuation Section too long
I have a multithread AHK_H script that works perfectly fine.
However, when I compile that script and run the exe, it says continuation section is too long.
Please advise.
However, when I compile that script and run the exe, it says continuation section is too long.
Please advise.
Re: Continuation Section too long
Compile the script without compression, then use ResHacker to get the compiled script from your exe, then you can check why the continuation section is too long.
You can then split the section in 2 or more ones:
You can also try using AHK_H v2 which has been improved and has no limit for line or continuation section.
You can then split the section in 2 or more ones:
Code: Select all
var:="
(
...
)"
var.="
(
...
)"
...
Re: Continuation Section too long Topic is solved
@HotKeyItHotKeyIt wrote: ↑01 Jan 2021, 06:21Compile the script without compression, then use ResHacker to get the compiled script from your exe, then you can check why the continuation section is too long.
You can then split the section in 2 or more ones:You can also try using AHK_H v2 which has been improved and has no limit for line or continuation section.Code: Select all
var:=" ( ... )" var.=" ( ... )" ...
The threads in my script contain the classMemory lib functions.
Code: Select all
AhkThread("#NoTrayIcon `n#Include classMemory.ahk
(
WinWait, Street Fighter V
_classmemory.setSeDebugPrivilege()
if (_ClassMemory.__Class != ""_ClassMemory"")
msgbox class memory not correctly installed. Or the (global class) variable ""_ClassMemory"" has been overwritten
Capcom:=
Capcom:= new _ClassMemory(""Street Fighter V"", """", hProcessCopy)
; Check if the above method was successful.
if !isObject(sfv)
{
if (hProcessCopy = 0)
msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter.
else if (hProcessCopy = """")
msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
}
if !(SFV.isHandleValid())
{
msgbox, Program NOT LOADED!
ExitApp
}
Array:= SFV.hexStringtoPattern(""48 4F 54 42 41 52 2E 44 41 54 00 00 01 00 00 00 70"")
controller:= SFV.processPatternScan(,, Array*)
If controller=0
{
Msgbox Controller ARRAY NOT FOUND
exitapp
}
Key0:=XIV.readstring(controller+Data)
Key1:=XIV.readstring(controller+(Data+add))
Key2:=XIV.readstring(controller+(Data+(add*2)))
Key3:=XIV.readstring(controller+(Data+(add*3)))
Key4:=XIV.readstring(controller+(Data+(add*4)))
Key5:=XIV.readstring(controller+(Data+(add*5)))
Key6:=XIV.readstring(controller+(Data+(add*6)))
Key7:=XIV.readstring(controller+(Data+(add*7)))
Key8:=XIV.readstring(controller+(Data+(add*8)))
Key9:=XIV.readstring(controller+(Data+(add*9)))
Key10:=XIV.readstring(controller+(Data+(add*10)))
Key11:=XIV.readstring(controller+(Data+(add*11)))
Key12:=XIV.readstring(controller+(Data+(add*12)))
)")
But if you can, I'd greatly appreciate knowing how. lol Thanks
Last edited by Galaxis on 01 Jan 2021, 13:52, edited 1 time in total.
Re: Continuation Section too long
@HotKeyIt But as stated before, all that above works fine, as long as the script isn't compiled. The Exe is the problem.
Re: Continuation Section too long
Try using CreateScript:
Code: Select all
#Persistent
thread:=AhkThread(CreateScript("ClassMemory:ClassMemoryEnd") "
(
#NoTrayIcon
WinWait, Street Fighter V
_classmemory.setSeDebugPrivilege()
if (_ClassMemory.__Class != ""_ClassMemory"")
msgbox class memory not correctly installed. Or the (global class) variable ""_ClassMemory"" has been overwritten
Capcom:=
Capcom:= new _ClassMemory(""Street Fighter V"", """", hProcessCopy)
; Check if the above method was successful.
if !isObject(xiv)
{
if (hProcessCopy = 0)
msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter.
else if (hProcessCopy = """")
msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
}
if !(SFV.isHandleValid())
{
msgbox, Program NOT LOADED!
ExitApp
}
Array:= SFV.hexStringtoPattern(""48 4F 54 42 41 52 2E 44 41 54 00 00 01 00 00 00 70"")
controller:= SFV.processPatternScan(,, Array*)
If controller=0
{
Msgbox Controller ARRAY NOT FOUND
exitapp
}
)")
ClassMemory:
Return
#Include classMemory.ahk
ClassMemoryEnd:
Return
Re: Continuation Section too long
@HotKeyIt
Thanks.
CreateScript is interesting! But stuff outside the thread Isn't visable to anything inside the thread. So i can't use classMemory
Code: Select all
ClassMemory:
Return
#Include classMemory.ahk
ClassMemoryEnd:
Return
CreateScript is interesting! But stuff outside the thread Isn't visable to anything inside the thread. So i can't use classMemory
Re: Continuation Section too long
@HotKeyIt
You helped me solve the problem though. Using compression on the Exe caused it to throw error "Continuation Section Too Long"
By you telling me to uncheck compression... the script/exe worked instantly. Compression was the problem. LOL
You helped me solve the problem though. Using compression on the Exe caused it to throw error "Continuation Section Too Long"
By you telling me to uncheck compression... the script/exe worked instantly. Compression was the problem. LOL
Re: Continuation Section too long
So it must be very hard on the limit, compressed lines are crypted and are longer than pure text.
CreateScript will copythe part between ClassMemory and ClassMemoryEnd and include it in script, so it will be inside the thread.
CreateScript will copythe part between ClassMemory and ClassMemoryEnd and include it in script, so it will be inside the thread.
Re: Continuation Section too long
Hmm. Well, the readmemory functions in classmemory don't work when using using that CreateScript method.
So, I did this simple test here, and the outer variable not visible to the thread. With that result, I assumed is why #include classmemory wasn't detected, and no functions initialized as they should.
@HotKeyIt
The variable outside isn't being seen. I guess I'm missing some context. If it can work, this is definitely a preferred way of retrieving data from the main thread.
So, I did this simple test here, and the outer variable not visible to the thread. With that result, I assumed is why #include classmemory wasn't detected, and no functions initialized as they should.
Code: Select all
#SingleInstance force
#Persistent
thread:=Ahkthread(CreateScript("ClassMemory:ClassMemoryEnd") "
(
Loop
{
Msgbox % var
}
)")
ClassMemory:
Var:="The sky is blue"
Return
ClassMemoryEnd:
Return
F1::exitapp
return
@HotKeyIt
The variable outside isn't being seen. I guess I'm missing some context. If it can work, this is definitely a preferred way of retrieving data from the main thread.
Re: Continuation Section too long
Code: Select all
#SingleInstance force
#Persistent
thread:=Ahkthread(CreateScript("ClassMemory:ClassMemoryEnd") "
(
Msgbox % var
)")
Sleep 3000
MsgBox
ExitApp
ClassMemory:
Var:="The sky is blue"
ClassMemoryEnd:
Return
F1::exitapp
return
Re: Continuation Section too long
@HotKeyIt
Thanks man. And stay awesome
Thanks man. And stay awesome