View previous topic :: View next topic |
Author |
Message |
paul44 Expert Cheater Reputation: 2
Joined: 20 Jul 2017 Posts: 152
|
Posted: Tue Sep 07, 2021 12:11 pm Post subject: OpenFileDialog does not attach process ? [Solved] |
|
|
see info here: [ https://imgur.com/a/HjpmexY ]
when i attach the game via 'openfiledialog' (either double-clicking or select 'Open'), the process will not attach properly most of the time. (seems like a 50/50% chance)
if i then attach manually (via File menu) or do another 'openfiledialog', it will always attach properly.
Note: CE does find the correct procId initially; just the 'process' variable (?) remains nil, it seems (just guessing here)
this is more of an annoyance then anything else, but perhaps there is some elegant workaround?!
Last edited by paul44 on Wed Sep 08, 2021 12:00 pm; edited 1 time in total |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Tue Sep 07, 2021 1:28 pm Post subject: |
|
|
Update to 7.3
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Sep 07, 2021 2:14 pm Post subject: |
|
|
after creating a process you'll have to wait for it to properly load
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
paul44 Expert Cheater Reputation: 2
Joined: 20 Jul 2017 Posts: 152
|
Posted: Wed Sep 08, 2021 11:58 am Post subject: compare process versus openDialog_name... |
|
|
this seems to do the trick. while testing, did print_checks of 'process' and it seemed to "complete loading" between 2~5 secs...
detail: on 1 occassion, it still "failed" (although uncertain about its cause), which is why i've added the additional 'openprocess'.
(did 5~6 reboot tests - only way to be sure - with success)
[code]if ( bCorrectProc == '9' ) then
openProcess(myGame)
while process ~= myGame do
openProcess(myGame)
sleep(1000)
end
openProcess(myGame)
end[/code]
ps: did some googling on "how to check when program is fully loaded", and one suggestion @stackoverflow talked about "enumerating windows" ~ which made me think about the 'enumModules()' function.
did some 'print(enumModules()[1].Name)' as well, and indeed one does get the proper name upon successfull load?! unfortunately, in the while loop it gives me a 'index nil value' error. tried it with procId, but that kept giving me a nil value. and since i already got a solution...
|
|
Back to top |
|
|
Birdi Expert Cheater Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Wed Sep 08, 2021 3:09 pm Post subject: |
|
|
You can just toss in a case for "if procId ~= nil" to skip over execution and sleep some, until it's not? Just an idea.
Not sure if it's supported in CE's lua, but you can try a repeat-until loop as well? Not home to test it right now.
_________________
Trying to learn!
Add me on Discord if you want hands-on help: Birdi#0007 |
|
Back to top |
|
|
|