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 


Form Designer ? Table Script?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Tue Feb 09, 2016 1:45 pm    Post subject: Form Designer ? Table Script? Reply with quote

How do I manually edit a form created by form designer?


I want to use the form created in form designer, BUT have the form built and destroyed by a Table Script.

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Feb 09, 2016 2:11 pm    Post subject: Reply with quote

you can access any object using formname.objectname and edit the properties as you see fit
_________________
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
View user's profile Send private message MSN Messenger
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Tue Feb 09, 2016 3:19 pm    Post subject: Reply with quote

Sorry for my ignorance here.

So I cant view the Lua code I created in Form Designer?

I notice the encoding is ASCII85 in the .ct file but I have failed to convert it to Lua.

_________________
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Feb 09, 2016 3:50 pm    Post subject: Reply with quote

Form Designer doesn't create Lua code for buttons, labels, sizes, positions, styles, etc. It is a binary data.

Then that binary data is compressed (zlib), then converted to a string (base85 encoding) so it could be saved in text/XML file (CT file is XML file)


Of course you can assign/create "onClick" function and FormDesigner will append this to Lua Script window.

For example, onclick for CELabel1 will be:
function CELabel1Click(sender)

end

This is the only connection between FormDesigner and Lua script.

_________________
Back to top
View user's profile Send private message MSN Messenger
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Tue Feb 09, 2016 4:21 pm    Post subject: Reply with quote

thanks mgr.

So I CANT design a form and view that form to learn how its built?


So I have to learn LUA parameters and placement the hard way Rolling Eyes . The 'sender' part is easy.

Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.

This is really disappointing.

_________________
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Feb 09, 2016 4:39 pm    Post subject: Reply with quote

I saw once a script which gets components properties from existing form created with FormDesigner.

I think it is possible to write converter, but, it won't be perfect.







"So I CANT design a form and view that form to learn how its built? "
You can install Lazarus, create form with any components. Save your project. Open LFM file with text editor. That way you can learn something.


For example, I made this form:


Launched looks like this:



LFM file looks like this:
Code:
object Form1: TForm1
  Left = 365
  Height = 183
  Top = 152
  Width = 329
  Caption = 'Form1'
  ClientHeight = 183
  ClientWidth = 329
  LCLVersion = '1.3'
  object Panel1: TPanel
    Left = 20
    Height = 143
    Top = 20
    Width = 289
    Align = alClient
    BorderSpacing.Around = 20
    Caption = 'Panel1'
    ClientHeight = 143
    ClientWidth = 289
    TabOrder = 0
    object Button1: TButton
      AnchorSideLeft.Control = Panel1
      AnchorSideLeft.Side = asrCenter
      AnchorSideBottom.Control = Panel1
      AnchorSideBottom.Side = asrBottom
      Left = 107
      Height = 30
      Top = 102
      Width = 75
      Anchors = [akLeft, akBottom]
      BorderSpacing.Bottom = 10
      Caption = 'Button1'
      TabOrder = 0
    end
    object Label1: TLabel
      AnchorSideRight.Control = Panel1
      AnchorSideRight.Side = asrBottom
      AnchorSideBottom.Control = Panel1
      AnchorSideBottom.Side = asrBottom
      Left = 249
      Height = 15
      Top = 122
      Width = 34
      Anchors = [akRight, akBottom]
      BorderSpacing.Right = 5
      BorderSpacing.Bottom = 5
      Caption = 'Label1'
      ParentColor = False
    end
  end
end



From that, we can write Lua script.




Code:
myForm=createForm()
myForm.Left = 365
myForm.Height = 183
myForm.Top = 152
myForm.Width = 329
myForm.Caption = 'Form1'

myPanel=createPanel(myForm)
myPanel.Left = 20
myPanel.Height = 143
myPanel.Top = 20
myPanel.Width = 289
myPanel.Align = alClient
myPanel.BorderSpacing.Around = 20
myPanel.Caption = 'Panel1'

myButton=createButton(myPanel)
myButton.AnchorSideLeft.Control = myPanel
myButton.AnchorSideLeft.Side = asrCenter
myButton.AnchorSideBottom.Control = myPanel
myButton.AnchorSideBottom.Side = asrBottom
myButton.Anchors = '[akLeft, akBottom]'
myButton.BorderSpacing.Bottom = 10
myButton.Caption = 'Button1'
myButton.Height = 30
myButton.Top = 102
myButton.Width = 75


myLabel=createLabel(myPanel)
myLabel.AnchorSideRight.Control = myPanel
myLabel.AnchorSideRight.Side = asrBottom
myLabel.AnchorSideBottom.Control = myPanel
myLabel.AnchorSideBottom.Side = asrBottom
myLabel.Height = 15
myLabel.Width = 34
myLabel.Anchors = '[akRight, akBottom]'
myLabel.BorderSpacing.Right = 5
myLabel.BorderSpacing.Bottom = 5
myLabel.Caption = 'Label1'



Should look like this:

_________________


Last edited by mgr.inz.Player on Tue Feb 09, 2016 4:58 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Tue Feb 09, 2016 4:58 pm    Post subject: Reply with quote

installing now.


This will allow me to establish the basic design. Then just convert the scale and postition.

Very grateful. TY


mgz you are the man.

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Feb 09, 2016 5:03 pm    Post subject: Reply with quote

akumakuja28 wrote:
thanks mgr.

So I CANT design a form and view that form to learn how its built?


So I have to learn LUA parameters and placement the hard way Rolling Eyes . The 'sender' part is easy.

Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.

This is really disappointing.

keep in mind that building a form with code is a lot slower than using a binary setup.
that a lot of people use code instead of the designer doesn't mean it's the best solution. They just copy/paste eachother and go from that. (i still see people use the deprecated and undocumented classless functions to access objects. And sometimes even a mix of them)

_________________
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
View user's profile Send private message MSN Messenger
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Tue Feb 09, 2016 6:09 pm    Post subject: Reply with quote

Dark Byte wrote:
akumakuja28 wrote:
thanks mgr.

So I CANT design a form and view that form to learn how its built?


So I have to learn LUA parameters and placement the hard way Rolling Eyes . The 'sender' part is easy.

Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.

This is really disappointing.

keep in mind that building a form with code is a lot slower than using a binary setup.
that a lot of people use code instead of the designer doesn't mean it's the best solution. They just copy/paste eachother and go from that. (i still see people use the deprecated and undocumented classless functions to access objects. And sometimes even a mix of them)



I understand why you would use binary. File size, etc ....

I was just hoping to use the The Form builder which is very simple and intuitive vs learning all the commands, parameter, and parent etc... Seems easier for me to tear it apart vs building it and figuring out what I did wrong. I have established a quick way to build then use as reference. Plus everything in FormDesigner is Listed the same as control/set parameter's. No Biggie.

I agree. I would rather know the makeup of the Lua exactly right now.
I have no idea what that means yet

TY.

_________________
Back to top
View user's profile Send private message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 152

PostPosted: Sun Oct 17, 2021 8:48 am    Post subject: use form data in Lua script? Reply with quote

Is it possible to use the form data (<MyForm Class="TCEForm" Encoding="Ascii85">eUs...</MyForm>) from within a Lua script (incl startup)?

Reason: I'd like to offer a script that others can copy/paste into their own table, without the need of having it saved explicitly in their table ?

Already requested here: [ https://www.cheatengine.org/forum/viewtopic.php?t=613440&start=0&postdays=0&postorder=asc&highlight=&sid=47ea3bf6072f9fbcdbdf406c3cf0ae2c ]


btw: tried copy/paste of xml_part into new table: it will show up, i can edit it, but the script - calling the form - does not seem to work...
(even save as .frm and then load/save in other table does not seem to get it working either ~ can edit it though)
-EDIT-: I stand corrected: tried with "new" & existing table, and that worked fine (either loading a .FRM or .LFM file).
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