View previous topic :: View next topic |
Author |
Message |
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
Posted: Fri Feb 02, 2018 10:05 am Post subject: How to make .NFO file open through Trainer? |
|
|
I was wondering if it is possible to open nfo file through trainer (like from a About button)
I already have made .nfo file of the trainer note and everything just need them to open like other people have(in patch, crack, etc)
Any help?
_________________
"If you are good at something,never do it for free"-The Joker
I know you are looking at this post, Hitler |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Fri Feb 02, 2018 11:05 am Post subject: |
|
|
I imagine you can just pass the filepath to shellExecute like you would for a url and have the OS handle opening it with the default program... untested however.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Fri Feb 02, 2018 11:16 am Post subject: |
|
|
if the .nfo is inside the .EXE use the getCheatEngineDir() function to get the path to the extracted CE folder
if the .nfo is next to the .EXE use the TrainerOrigin variable to get the path to the .exe trainer
once you have the path you can do something like:
Code: |
shellExecute('notepad', pathtofile)
|
--
if it's inside the table itself, use a form with a memory field, just put the contents of the .nfo in there and show that
_________________
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 |
|
|
Death GOD 7 Expert Cheater Reputation: 0
Joined: 21 Jan 2017 Posts: 105 Location: Heaven and Hell
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Feb 08, 2018 11:20 pm Post subject: |
|
|
getCheatEngineDir doesn't take any arguments it simply returns where the real trainer files got extracted to (the EXE CE generates is essentially a self-extracting archive containing the actual exe trainer and the files it needs to run)
Quote: | what do i put in shellExecute? | shellExecute('notepad', the path to the file)
a simple test of
Code: | local cepath = getCheatEngineDir()
print(cepath)
local filepath = cepath .. 'test.nfo'
print(filepath) |
gets you something like
C:\Users\<username>\AppData\Local\Temp\cetrainers\CETB9EE.tmp\extracted\
C:\Users\<username>\AppData\Local\Temp\cetrainers\CETB9EE.tmp\extracted\test.nfo
so now you have the path to the file and you know what to do with it right? yeah, pass it to shellExecute
shellExecute('notepad', filepath)
of course, you'd take out the prints once you're done testing. Just make sure you actually add the file when you generate the trainer or it won't exist
as for other programs... not sure of anything that you can be confident of existing... maybe run cmd with the type command... something like shellExecute('cmd', ('/c type "%s" & pause'):format(filepath)), of course you could just show a form with a readonly (and probably scrollable) "memo" displaying the contents eg ( https://github.com/FreeER/CE-Examples/tree/master/LoadingFiles )
Code: | local cepath = getCheatEngineDir()
local filepath = cepath .. 'test.nfo'
local f = io.open(filepath, 'r')
CETrainer.CEMemo1.Lines.Text = f:read('*all')
f:close() |
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1260
|
Posted: Fri Feb 16, 2018 11:25 pm Post subject: |
|
|
Store / write the data in the cetriner.
then give him a record file path.
then recall it with a recall / button!
Code: |
function getTrainerRealPath1()
local t
t= os.getenv("Temp") .. "\\cetrainers";
return t
end
function SaveSettings()
if MyPath then
settingsFile = os.rename(MyPath.."\\File.txt",MyPath.."\\Info_File.txt")
if (settingsFile == nil) then
settingsFil = io.open(MyPath.."\\Info_File.txt", "a+")
settingsFil:write(info_files)
control_setCaption(UDF1_CEMemo1, info_file)
info_file=info_files
settingsFil:close()
end
MyLoadSettings()
end
end
function MyLoadSettings(sender)
if MyPath then
settingsFile = io.open(MyPath.."\\Info.txt", "r+")
if (settingsFile ~= nil) then
new_files=settingsFile:read("*all")
control_setCaption(UDF1_CEMemo1, settingsFile:read("*all"))
settingsFile:close()
control_setCaption(UDF1_CEMemo1, info)
end
end
end
function MySaveSettings()
if MyPath then
string= control_getCaption(UDF1_CEEdit1)
if ( string == "" ) then
messageDialog( "bla..bla..", 4, 2 );
MyLoadSettings()
return false
end |
Correction is possible in this code. you are the master.
--------------
https://www.dropbox.com/s/851nodtc2ielqr5/By-KARAHANLI-Music.CT?dl=0
Listen to some music. but 4 songs 105MB!
Please find a solution to this .xm format.
.midi formatio is very convenient!
_________________
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Feb 17, 2018 9:57 am Post subject: |
|
|
Yeah you can write the file with lua's file handling utilities and then follow the same steps as above to open it
@Aylin purely because you named the functions with the word "Settings" which would presumably be user changeable (at least within the trainer) I wouldn't suggest using the cetrainers folder for 2 reasons
1. It's in the temp directory so it'll presumably be deleted at some point, possibly before the user is done using the trainer. It'd probably be annoying to set things up the way you wanted and then have all your settings lost because windows decided to free up some space or they ran ccleaner etc.
2. If it's possible for any settings to break the trainer (invalid resolution, filepaths, etc.) then the user may not know how to find the settings file to delete it and get back to the defaults if it's off in the temp directory. If you use TrainerOrigin then it'll be created right next to the trainer executable that the user clicks on to launch it.
As for getTrainerRealPath1 just be aware that someone could create a custom version of CE that uses a different folder and breaks this (perhaps there's some anticheat out there that creates that folder and makes it read only or checks for exes launched out of it)
Just something to be aware of when you choose to hardcode things instead of using given functions. Same applies to the code I wrote since it depends on "cetrainers" but I know that I was aware of it at the time so
_________________
|
|
Back to top |
|
|
PrometheusPB How do I cheat? Reputation: 0
Joined: 01 Apr 2018 Posts: 5
|
Posted: Tue Apr 03, 2018 11:11 pm Post subject: Saw your sig calling me out |
|
|
Okay Death God 7, so you know me, but I don't know you. Which one of the select sarcastic few on earth who know me are you? I can't PM you yet , so reveal yourself to me before I have to go and make another post at you
|
|
Back to top |
|
|
|