| View previous topic :: View next topic |
| Author |
Message |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Sun Jul 16, 2023 6:35 am Post subject: Mono not usable in target, trainer attaching wrong process |
|
|
im trying to make a trainer on a game using mono (GRIME) and i have no problem activating it when im in the CT and i attach the process manually
the thing is when i use OpenProcess("GRIME.exe") it attach to B15C-GRIME.exe
but the good one is 5DF8-GRIME.exe , i got only one game running and do not understand why?
strangely it's when im writting post asking for help that i found solutions, i realized, it attach to processes and not only visible applications so i searched in cheat engine attach list in the processes tabs and found out that my trainer attach himself to old trainer processes still running named GRIME.exe too
so i got a new questions do i have to manually kill the process each time i close my trainer and where can i change the name used by my trainer ? because i named my exe Test16 and i thought it was sufficient
EDIT: Apparently it was sufficient and i have to manually kill trainer process sometimes but do not need to do anything else than renaming the exe i don't know why processes didn't kills themself in precedent tests
Oh and Now i got a DLL injection Failed error
EDIT: i just had to go inside the lua script and put LaunchMonoDataCollector() inside a function instead of outside and it worked fine
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4709
|
Posted: Sun Jul 16, 2023 11:04 am Post subject: |
|
|
Don't name your trainer the same thing as the game
The trainer form's OnClose event should do at least this:
| Code: | UDF1.OnClose = function()
closeCE()
return caFree
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Sun Jul 16, 2023 5:38 pm Post subject: |
|
|
well i already got it since i use trainergenrator to compile it, i search and found
that i could force windows to kill my process like this
| Code: |
function OnFormClose(Sender)
os.execute("taskkill /F /IM GRIMETrainer.exe")
closeCE()
return caFree
end
CETrainer.OnClose = OnFormClose
|
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sun Jul 16, 2023 5:54 pm Post subject: |
|
|
| wayden wrote: | well i already got it since i use trainergenrator to compile it, i search and found
that i could force windows to kill my process like this
| Code: |
function OnFormClose(Sender)
os.execute("taskkill /F /IM GRIMETrainer.exe")
closeCE()
return caFree
end
CETrainer.OnClose = OnFormClose
|
|
No need for a separate function
| Code: |
CETrainer.OnClose = function()
os.execute("taskkill /F /IM GRIMETrainer.exe")
closeCE()
return caFree
end
|
|
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Mon Jul 17, 2023 2:29 pm Post subject: |
|
|
| Quote: | No need for a separate function
Code: |
I thought the TrainerGenerator will erase it otherwise
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Mon Jul 17, 2023 2:57 pm Post subject: |
|
|
| wayden wrote: | | Quote: | No need for a separate function
Code: |
I thought the TrainerGenerator will erase it otherwise |
Why would it? You are assigned an anonymous function to an event of that object. It should work just the same.
|
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Mon Jul 17, 2023 5:38 pm Post subject: |
|
|
| Quote: | | Why would it? You are assigned an anonymous function to an event of that object. It should work just the same. |
Because every time i use the auto trainer generator it regenerate the part of the code containing
| Code: |
CETrainer.OnClose = function()
closeCE()
return caFree
end
|
so i thought there was no reason for it to not remove the line if i add it, i could probably just put it outside of the reseting part but i don't know wich of the two anonymous function will get assigned to the onclose event, perhaps both
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Tue Jul 18, 2023 5:53 am Post subject: |
|
|
| wayden wrote: |
Because every time i use the auto trainer generator it regenerate the part of the code containing
| Code: |
CETrainer.OnClose = function()
closeCE()
return caFree
end
|
so i thought there was no reason for it to not remove the line if i add it, i could probably just put it outside of the reseting part but i don't know wich of the two anonymous function will get assigned to the onclose event, perhaps both |
There's only one function. It's only anonymous if you omit the name and assign a function to the event directly. I am not sure what you mean by "so i thought there was no reason for it to not remove the line if i add it". Could you elaborate?
|
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Tue Jul 18, 2023 9:13 am Post subject: |
|
|
When you use the autotrainer generator it generates in your lua file some lines in this part there is already :
| Code: |
CETrainer.OnClose = function()
closeCE()
return caFree
end |
everytime i'll use it to compile my trainer it regenerate this part so if i modify anything in this part of the lua file it will just be reseted before compilation, wich mean adding a line inside the premade function will probably have no effect because it will be reseted to default before compilation
so if add the function outside of the reseting part i would have 2 assignement of anonymous function to the same event
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Tue Jul 18, 2023 10:11 am Post subject: |
|
|
| Do you have to regenerate every time?
|
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Tue Jul 18, 2023 10:56 am Post subject: |
|
|
| i think i have to if i want to have an taskbar app icon different than CheatEngine and i don't know how to manually compile it otherwise, i know i can just Save as .EXE instead of .CT and it will give me possibility to compile without regenerating the lua part but i think i'll lose the app icon in taskbar
|
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1531
|
Posted: Tue Jul 18, 2023 11:21 am Post subject: |
|
|
| wayden wrote: | | i think i have to if i want to have an taskbar app icon different than CheatEngine and i don't know how to manually compile it otherwise, i know i can just Save as .EXE instead of .CT and it will give me possibility to compile without regenerating the lua part but i think i'll lose the app icon in taskbar |
This code makes the icon visible in the taskbar.
Add it somewhere in your code where it will activate after it disappears.
| Code: | | CETrainer.ShowInTaskBar="stAlways" |
Of course if you use deadly codes in "OnClose" (cafree), the codes won't work.
Maybe in between work you want to use:
| Code: | CETrainer.Hide()
-- or
CETrainer.Show() |
_________________
|
|
| Back to top |
|
 |
|