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 


Can I modify TTrainerForm

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

Joined: 10 Nov 2018
Posts: 14

PostPosted: Tue Jan 18, 2022 8:00 pm    Post subject: Can I modify TTrainerForm Reply with quote

I'm trying to change the size of the main form (which seems to be called 'TTrainerForm'), but when I reference it via CETrainer_TTrainerForm.Height, I get an error about "attempt to index a nil value (global 'CETrainer_TTrainerForm')".

Can I not modify the main window via Lua?
Back to top
View user's profile Send private message
Skyrimfus
Cheater
Reputation: 1

Joined: 17 Mar 2016
Posts: 42

PostPosted: Tue Jan 18, 2022 8:59 pm    Post subject: Reply with quote

Code:
form = nil
for i=0, GetFormCount()-1 do
 if GetForm(i).ClassName == "TTrainerForm" then from = GetForm(i) end
end

form.setSize(100,100)
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Wed Jan 19, 2022 5:53 am    Post subject: Reply with quote

You just have to make sure you spelled the Trainer name (Form name) correctly.
The non-existent form (Trainer.Name) will give a "nil" error.

Code:
CETrainer_TTrainerForm.Height
CETrainer.Height
CETrainer_TTrainer.Height
UDF1.Height
yourFormName.Height
Back to top
View user's profile Send private message
User100
Newbie cheater
Reputation: 0

Joined: 10 Nov 2018
Posts: 14

PostPosted: Wed Jan 19, 2022 1:29 pm    Post subject: Reply with quote

Unfortunately, neither of those methods worked.

Checking for the available names didn't return the "TTrainerForm" at all. It returned one named "TMainForm", but that seems to be something else, as its size was different. None of the other forms it returned contained the size for the main form either.

The form names were correct (I checked them about a dozen times).

But I did finally find out how to access it: While the form in the Object Inspector is called CETrainer:TTrainerForm, you can just access its properties via CETrainer, e.g. CETrainer.Height.
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