| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| User100 Newbie cheater
 
 ![]() Reputation: 0 
 Joined: 10 Nov 2018
 Posts: 14
 
 
 | 
			
				|  Posted: Tue Jan 18, 2022 8:00 pm    Post subject: Can I modify TTrainerForm |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Skyrimfus Cheater
 
 ![]() Reputation: 1 
 Joined: 17 Mar 2016
 Posts: 43
 
 
 | 
			
				|  Posted: Tue Jan 18, 2022 8:59 pm    Post subject: |   |  
				| 
 |  
				|  	  | 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 |  | 
	
		|  | 
	
		| ByTransient Expert Cheater
 
  Reputation: 5 
 Joined: 05 Sep 2020
 Posts: 240
 
 
 | 
			
				|  Posted: Wed Jan 19, 2022 5:53 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| User100 Newbie cheater
 
 ![]() Reputation: 0 
 Joined: 10 Nov 2018
 Posts: 14
 
 
 | 
			
				|  Posted: Wed Jan 19, 2022 1:29 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		|  |