View previous topic :: View next topic |
Author |
Message |
DxKE How do I cheat? Reputation: 0
Joined: 30 Sep 2021 Posts: 7
|
Posted: Tue Oct 12, 2021 3:31 pm Post subject: How do I open a table file with lua |
|
|
Hii , I want to add a .reg file with my trainer and make a lua so that if i press a button in the form, that .reg file will execute .Anyone know how to open table files do this?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Tue Oct 12, 2021 3:41 pm Post subject: |
|
|
.reg = registry file. I suggest you change your extension; however, you can open a file like this:
Code: |
shellExecute('path_to_file', 'open', 'SW_SHOWNORMAL')
|
Don't forget to escape backslashes i.e. instead of '\' use '\\'.
|
|
Back to top |
|
|
DxKE How do I cheat? Reputation: 0
Joined: 30 Sep 2021 Posts: 7
|
Posted: Tue Oct 12, 2021 4:22 pm Post subject: |
|
|
LeFiXER wrote: | .reg = registry file. I suggest you change your extension; however, you can open a file like this:
Code: |
shellExecute('path_to_file', 'open', 'SW_SHOWNORMAL')
|
Don't forget to escape backslashes i.e. instead of '\' use '\\'. |
Thank you so much, if I add the file in cheat engine table what would be the path?
For example, we can use playSound(findTableFile('sound.wav'))
is there anylike like this for other file type?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Tue Oct 12, 2021 4:43 pm Post subject: |
|
|
You can use TrainerOrigin which sets a variable that contains the path of the trainer that launched Cheat Engine (Only set when launched as a trainer)
Code: |
local path = TrainerOrigin
|
Other functions should you need them:
Code: |
getFileList(Path:string, searchMask:string OPTIONAL, SearchSubDirs: boolean OPTIONAL, DirAttrib: integer OPTIONAL): Returns an indexed table with filenames
getDirectoryList(Path:string, SearchSubDirs: boolean OPTIONAL): Returns an indexed table with directory names
extractFileName(filepath): Returns the filename of the path
extractFileExt(filepath): Returns the file extension of the path
extractFileNameWithoutExt(filepath): Returns the filename of the path, without the extension
extractFilePath(filepath): Removes the filename from the path
|
|
|
Back to top |
|
|
|