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 


AllMemoryRecords.active = false Before CETrainer.close()

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Mon Aug 28, 2023 5:21 am    Post subject: AllMemoryRecords.active = false Before CETrainer.close() Reply with quote

How can I access the onclick for the X close button on CETrainer ?
I want that all memory records execute their [DISABALE] part and become active = false before the trainer closes.

Anyone can please help me with this?
Back to top
View user's profile Send private message
Autem
Expert Cheater
Reputation: 1

Joined: 30 Jan 2023
Posts: 156

PostPosted: Mon Aug 28, 2023 8:55 am    Post subject: This post has 1 review(s) Reply with quote

Hi, I just have to ask finally after seeing so many different threads all for your trainer, all based around locking down your users and disabling their functions and deleting their copies, etc... How much are you trying to charge people for this once the people here finish making it for you? I'm genuinely curious because I might also want to get into selling trainers although I previously assumed my not knowing how to make them would stop me. You seem to be having luck getting the others to piece these issues together for you, which you will then profit from, so I might as well also try that in the near future too. Also what game is this one for? How can I become a customer of yours, and for what other games too? You've stimulated my interest!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4703

PostPosted: Mon Aug 28, 2023 10:18 am    Post subject: Reply with quote

I'd try to hook the OnClose property of the main form. Make sure you save and execute the original one (if it exists).

For disabling memory records, loop through all the memory records in the address list and set the Active property to false. See documentation on the AddressList class for more information.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1522

PostPosted: Mon Aug 28, 2023 12:31 pm    Post subject: Reply with quote

Autem wrote:
Hi, I just have to ask finally after seeing so many different threads all for your trainer, all based around locking down your users and disabling their functions and deleting their copies, etc... ...


When I first started, I had the same kind of help requests.
Every solution code given got me a little bit closer to Lua.

I see you right.
But don't let the ignorance of enthusiastic people limit their ideas.
In this direction, please try to help those who have time.

----################-----
Ex Code;

Code:
CETrainer.OnClose=function()
alist=getAddressList()
  for i=0, alist.Count-1 do
    alist[i].Active=false
  end
showMessage("Trainer Closed!")
sleep(1200)
closeCE()
  return cafree
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Mon Aug 28, 2023 1:55 pm    Post subject: Reply with quote

@Autem
I dont ask the questions so that people here finish making it for me.
I'm a newbie to CE and Lua, recently interest on it has grown on me.
The people here answering are more experienced say like a Mentor/Teacher.
I'm like the student, and obviously when a student gets stuck on something or doesn't know something he/she asks question to the teacher to learn. Same with me I ask to learn how something is done when I get stuck.

AylinCE said it nicely, Every solution code given to me a makes my interest for CE and Lua grow even more.
Without the mentors answering the questions here people would lose interest.

The trainer I'm trying to make is actually a anti-cheater trainer to fight off cheaters. That is the reason for my locking down users , disabling functions and deleting their copies, etc... I dont want it to be misused in the wrong hands.

I am not charging anything so no profit. Just me and 2 other in game friends testing to see if we can fight off cheaters.

Like I said only recently so not for any other games just one.


@ParkourPenguin
I dont know how to hook the OnClose property of the main form.
I'll look at the documentation on the AddressList class

@AylinCE Thank you. I will try that snippet.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4703

PostPosted: Mon Aug 28, 2023 7:59 pm    Post subject: Reply with quote

Code:
local oldOnClose = MainForm.OnClose

MainForm.OnClose = function(sender, closeaction)
  if oldOnClose then
    closeaction = oldOnClose(sender, closeaction)
  end

  if closeaction == caFree then
    -- deactivate memory records
  end

  return closeaction
end

Deactivating memory records might be weird if you need to do them in a certain order (e.g. child records first)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Tue Aug 29, 2023 4:11 am    Post subject: Reply with quote

I used a different method now.
I hadn't noticed before, but while poking around found that there is already a readymade FormClose function.

CE->Table->"Your trainer Form"->Edit->Object Inspector(Events Tab)->OnClose

So mines looks like this now:

Code:
function CETrainer_FormClose(sender)
MemoryRecordList=getAddressList()
  for i=0, MemoryRecordList.Count-1 do
    MemoryRecordList[i].Active=false
  end
showMessage("Trainer Closing!")
return caFree
end


The loop works nicely. Thanks @ParkourPenguin & @AylinCE again for the point outs.

I have looked in the forum and found that there is this:
AddressList.disableAllWithoutExecute()
mentioned by Dark Byte here:
https://www.cheatengine.org/forum/viewtopic.php?t=610216
https://www.cheatengine.org/forum/viewtopic.php?t=609626

This disables the memory records without executing their [Disable] section I believe..

Is there such a thing as AddressList.disableAllWithtExecute()
Changing it to "With" in place of "Without" to make it so that [Disable] section is executed when disabled?
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 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