View previous topic :: View next topic |
Author |
Message |
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Dec 19, 2011 8:12 pm Post subject: Trainer [standalone]. Save/Load settings. |
|
|
I was intrigued by this topic: http://forum.cheatengine.org/viewtopic.php?t=544107
For now, all CE6 standalone trainers are extracting all needed files to: %temp%\cetrainers\CET{random}.tmp\extracted\
getCheatEngineDir() leads to above temporary folder.
and io.open("file.txt", "r") opens file.txt inside "extracted" folder
But how to get the trainer real path and use it? I made small modification to standalonephase2.dat file
([url=link down]download[/url]) (copy/paste/overwrite original) (backup original)
(DIFF)
Modified standalonephase2.dat causes additional file named TrainerRealPath.txt (yes, it's a pretty lame name ) to be created inside extracted directory - just after you launch your trainer but before it unpacks the needed files.
Now with this Lua code and standalonephase2.dat you can get trainer real path:
Code: | function getTrainerRealPath()
local t
local f = io.open("TrainerRealPath.txt", "r")
if (f ~= nil) then
t = f:read("*all")
f:close()
else
t = nil
end
return t
end |
You can use it to save trainer user options/settings (or logs, stats, etc)
for example:
Code: | MyPath = getTrainerRealPath() -- Trainer real path
function SaveSettings()
if MyPath then
settingsFile = io.open(MyPath.."Settings.ini", "w")
if (settingsFile ~= nil) then
settingsFile:write(control_getCaption(EDIT1).."\n") --diamonds
settingsFile:write(control_getCaption(EDIT2)) --playerspeed
settingsFile:close()
end
end
end
function LoadSettings()
if MyPath then
settingsFile = io.open(MyPath.."Settings.ini", "r")
if (settingsFile ~= nil) then
tmpAddDiamonds = settingsFile:read() --read line
tmpPlayerSpeed = settingsFile:read() --read line
settingsFile:close()
end
end
end |
Here, you have trainer ( it only loads values from file named settings.ini and saves all values when trainer is closed ) :
- standalone demo trainer (EXE file) [url=link down]LINK[/url]
- CT file (attachment). Of course "save settings", "load settings" do not work for CT and CETRAINER.
Edit:
Use TrainerOrigin instead. (variable added in CE6.2)
Description: |
|
Download |
Filename: |
save_load.ct |
Filesize: |
2.03 KB |
Downloaded: |
1692 Time(s) |
_________________
Last edited by mgr.inz.Player on Wed Apr 03, 2013 6:45 pm; edited 1 time in total |
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Wed Apr 03, 2013 5:52 pm Post subject: |
|
|
Interesting!
Can you re-upload the files?
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Wed Apr 03, 2013 5:56 pm Post subject: |
|
|
In 6.2 it's a variable named TrainerOrigin
_________________
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 |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Wed Apr 03, 2013 6:05 pm Post subject: |
|
|
Thanks!
Gonna test it now.
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Apr 03, 2013 6:22 pm Post subject: |
|
|
@Mother of hack, Indeed. What DB wrote.
@all
The above standalonephase2.dat is now useless.
But, I'm using standalonephase2.dat to do other things for me
Creates file with pids of all currently running processes + information about parent process for those. I just read that file with io.open("processes.txt", "r"):read()
As for saving trainer settings, I've made class (Lua class or whatever it is called in Lua) for such things. Saving window position, size, user preferences, etc.
I will create new topic for this when ready, probably with name: "LoadSaveOptions".
It's finished in 90% (Apr 15, 2012). It's almost universal/flexible. I can add more entries inside "settings" window with ease, all controls buttons are created automatically...
Here is trainer with "LoadSaveOptions" class:
http://forum.cheatengine.org/viewtopic.php?t=550742
To do:
- 5% - custom hotkeys (when I find some free time)
- 5% - testing, testing, ... (-//-)
_________________
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sat Apr 06, 2013 2:56 am Post subject: |
|
|
Any chance to have look in the source of it? .
_________________
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Mon Jul 08, 2019 6:01 pm Post subject: |
|
|
hi mgr.inz.Player and CEF ..
without saving files on the table,
Is it possible to record in Trainer?
So "MyPath = getMainForm ()", like "findTableFile ('record.txt')".
I designed a game.
progress in the game, I'm recording.
With the above code it will be exposed recorded files.
I don't want them to edit the .txt file on the Desktop.
Is it possible to record inaccessible file?
Thanks.
_________________
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Wed Jul 10, 2019 8:27 am Post subject: |
|
|
write a binary file, and/or use compression/encryption. might be able to make it hidden with shellExecute... should be able to put it in %userprofile% / SavedGames or something if you wanted, just because the default path is the table/trainer location doesn't mean you can't give an absolute path when opening the file.
I suppose you could also use the registry via the settings lua stuff but it seems locked to the CE key /shrug.
afaik there's no easy way to overwrite saved table files and resave the trainer.
_________________
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Wed Jul 10, 2019 3:32 pm Post subject: |
|
|
Thanks for the answer @FreeER
I think I can set the absolute path: "Temp" or "CE Autorun".
3 existing files will be saved.
I think I can put them in one folder.
I tried encryption, but the restore doesn't produce the same result.
What I'm trying to tell you is more clear here.
Please open the game and try to play.
On the table: "Win List", Level and xp records will come.
( A game open to development and in the beginning. )
Game Download: https://www.dosyaupload.com/6ud8
Without using VB, I will only work with CE Lua.
Thanks in advance for all your ideas.
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Wed Jul 10, 2019 8:12 pm Post subject: |
|
|
Aylin wrote: | ...
Without using VB, I will only work with CE Lua.
Thanks in advance for all your ideas. |
What does that mean?. Please explain...
In my opinion, CE has created mainly for hacking or as memory managing tool.
It's not created for game development. Making a game using CE, especially just to prove that CE can also be used to make things other than for memory management purposes.
Your statement by claiming not to use VB leads to an allusion to other people, especially users of VB programming.
I am one of those people who use VB and C-Sharp in making many applications, not just for making games.
And if you want to show that you are truly an expert at making games using cheat engines, then you should prove it by making an advance game like 3D games and others.
So, it would be better for you to explain the purpose of your statement in this forum. Because of your statement, seen by many people, including VB programmers.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Thu Jul 11, 2019 5:00 am Post subject: |
|
|
As far as I can tell, I do not claim "expertise".
I used VB, and I admit it's more advanced than CE Lua.
But my goal is: CE Lua's boundaries,
Except to interrupt or correct the game,
see if you can do a lot of different things, and show them.
I remember that copyright infringement and CE and CEF were warned.
There is much labor here; CE is causing people to be involved with codes.
This is a beautiful mission for the future.
Or so I think.
I agree: I still can't write code,
But that doesn't stop me from creating different issues.
Gifs, MP3 Player, Trainers, Games.
These and more are just steps.
Objective: Coding with fun.
Don't focus on cutting the game, time is running out.
Different topics lead to great goals.
Note: You may think I'm in the wrong place!
But to spread it, CE is a pretty good start.
I repeat: I will not give up CE Lua Script.
I exaggerate too much?
In my eyes, numbers and letters dance in harmony,
Each code seems to trigger a different life.
CE is a meaningful coding tool and spreading honor.
You were saying how @Corroder;
Cheers!
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Jul 11, 2019 9:35 am Post subject: |
|
|
Aylin wrote: | I repeat: I will not give up CE Lua Script.
I exaggerate too much?
In my eyes, numbers and letters dance in harmony,
Each code seems to trigger a different life.
CE is a meaningful coding tool and spreading honor.
You were saying how @Corroder;
Cheers! |
Seem you are unfair and not honest. I did almost my apps and game using VB and C-Sharp. When you said "Without using VB, I will only work with CE Lua.", of course, I feel you were insulting me because you knew how I did with my game apps and VB script.
Why you must say VB?. Is there any connections that VB scripts with your ambitions and your projects?. You no need to say like that or you can say Unity, Eclipse, Gideros, Love2D, and much other game development tools instead must say VB. There is no relation at all with your ambitions. No one will stumble your goal and your ambitions, but that will seem pretty and good if you do on a good way too without comparing what you did with others, except for learning purposes.
So, last words from me. goes on with all what you want and it's better to be wiser on the future.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Thu Jul 11, 2019 12:46 pm Post subject: |
|
|
Corroder wrote: |
"Without using VB, I will only work with CE Lua.", of course, I feel you were insulting me because you knew how I did with my game apps and VB script.
|
@Corroder, you totally misunderstood me.
I would never insult you, maybe it's a translation error.
But insulting! I'm sorry if you felt that way.
You are one of my favorite masters in this forum.
@Corroder, @FreeER, @DaSpamer and @mgrInzPlayer.
I did some projects with VB,
it has a very rich plugin and ready ".dll" power.
but I have reviewed CEF shares from the past to this day.
There is another soul at CE, another magic and development.
That's how I see it.
Senden: the game you do with VB, I asked him to experiment with CE Lua.
This is not to belittle,
I think you got it wrong and I'm sorry.
_________________
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Fri Jul 12, 2019 5:48 am Post subject: |
|
|
and solution ..
and again @mgrInzPlayer code.
The following code allows you to record all available transactions.
and restores the current recordings when the Trainer is turned on again.
Code: | function Save()
if settings then
settings.Value['label1'] = UDF1.CELabel1.caption --level
settings.Value['label2'] = UDF1.CELabel2.caption --xp
settings.Value['memo1'] = UDF1.CEMemo1.Lines.Text --win list
end
end
function Load()
if settings.Value['label1' and 'label2' and 'memo1'] ~= nil then
UDF1.CELabel1.caption = settings.Value['label1']
UDF1.CELabel2.caption = settings.Value['label2']
UDF1.CEMemo1.Lines.Text = settings.Value['memo1']
end
end
Load()
function FormClose(sender)
Save()
closeCE()
return caFree()
end |
And the most beautiful side: For Registration and Loading,
You don't need any files outside.
A completely local record.
again thanks @mgr.inz.Player
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Jul 13, 2019 9:43 am Post subject: |
|
|
The full game has done. Using CE Lua. (See how, NOT JUST VB)
Demo: https://youtu.be/_E5NxseE15Y
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|