Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


SaveOpenedFile not working when trainer is saved as .EXE

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
beagle
Cheater
Reputation: 0

Joined: 27 Aug 2014
Posts: 36

PostPosted: Wed Sep 13, 2017 7:19 pm    Post subject: SaveOpenedFile not working when trainer is saved as .EXE Reply with quote

I'm using the latest github build of CE so that memory scanning works with open file, and i'm using openfileasprocess/saveopenedfile.

Everything works fine when used as a cheat table, but once i save it as an .EXE, saveopenedfile seems to stop working.

Normally saveopenedfile will save a copy of the file you are modifying in the folder where the cheat table is located, but when saved as an .EXE it wont modify the original file or create a copy of it.

Also i had to transfer the file "standalonephase2.dat" from the cheat engine 6.7 bin folder to the github compiled CE folder since it gave an error when trying to create the .exe, saying the file wasnt found.

I get the same problem though when saving the cheat table as an .EXE using regular CE 6.7, so i'm not sure if it has to do with that standalonephase2.dat file.

edit: updated title for clarity
also .CETRAINER works like normal

edit2:
it works as an .exe if i use the same filename:

Code:

FileName= dialog.FileName
openFileAsProcess(FileName,false)
...
SaveOpenedFile(FileName)


but if i do this so it doesnt overwrite the file, it wont create a new copy:

Code:

FileName= dialog.FileName
openFileAsProcess(FileName,false)
...
SaveOpenedFile("new copy")


this is fine for me, but if someone knows why the .exe wont save a new copy or how to fix it that would be ideal
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25252
Location: The netherlands

PostPosted: Thu Sep 14, 2017 2:01 am    Post subject: Reply with quote

Use the TrainerOrigin variable for the path where the trainer exe is
_________________
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
View user's profile Send private message MSN Messenger
beagle
Cheater
Reputation: 0

Joined: 27 Aug 2014
Posts: 36

PostPosted: Thu Sep 14, 2017 1:05 pm    Post subject: Reply with quote

i'm unsure how to use TrainerOrigin since saveopenedfile only has one parameter for the file's name

also, can the file be easily saved in the location of the file you are modifying, rather than the trainer location?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites