Get Auto Assemble Edit Form

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Get Auto Assemble Edit Form

Post by S1N74X »

Hello,

i am currently tinkering around with CE Lua Forms and trying to get the "Auto Assemble Edit" From.
What i am trying to archive is to generate Template Function calls.
I know there are "copy paste" solutions for custom templates but they are op and i dont need all the functionality.

Following the Wiki i found this.
Spoiler

Code: Select all

{$lua}
if syntaxcheck then return end
[ENABLE]
for i = 0, getFormCount() - 1 do
  local frm = getForm(i)
  if frm.ClassName == 'TfrmAutoInject' then
  frm.show()
  end
end
[DISABLE]
The Problem is that this Method gives me the "Lua Script Edit" Form.

So any helpfull suggestions are welcome.
Thanks in advance.

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get Auto Assemble Edit Form

Post by S1N74X »

Ok i found out it myself.

getFormCount() only sees "active" forms. The "Auto Assemble edit:" Form is dynamic and not permanently open :)
Thread can be closed

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 482
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 243

Re: Get Auto Assemble Edit Form

Post by LeFiXER »

S1N74X wrote:
Wed Oct 19, 2022 5:44 pm
...
This will, however, create a new Auto Assembler window with the pre-defined text as the main body of the script:

Code: Select all

local aa = getMemoryViewForm().getComponent(279)
aa.doClick()

AAWindow = 'TfrmAutoInject'

function getFormByClass(n)
 if n == '' then return nil end
 for i = 0, getFormCount() - 1 do
  local frm = getForm(i)
  if frm.ClassName == n then
    return frm
  end
 end
end

local f = getFormByClass(AAWindow)
local script = f.getComponent(60)
script.Lines.Text = [[
{
  Game    : My Random Game
  Author  : LeFiXER
  Date    : 21/10/22

  More Stuff
}
[ENABLE]

// blah blah blah

[DISABLE]
]]

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get Auto Assemble Edit Form

Post by S1N74X »

LeFiXER wrote:
Fri Oct 21, 2022 6:22 pm

First of all thanks for your reply.
Got some questions :D
Where did index 279 and 60 come from ? CESource on GitHub ?
aa.doClick() should open a Form i guess but it gives me a access violation. It opens an "Service Descriptor Table" with no functionality

Is this intended ?
Am i missing something ?

Spoiler

Code: Select all

local aa = getMemoryViewForm().getComponent(279) <<<<<< where did you get the Index from ?  
aa.doClick() <<<<<<< gives me an access violation  

AAWindow = 'TfrmAutoInject'

function getFormByClass(n)
 if n == '' then return nil end
 for i = 0, getFormCount() - 1 do
  local frm = getForm(i)
  if frm.ClassName == n then
    return frm
  end
 end
end

local f = getFormByClass(AAWindow)
local script = f.getComponent(60)  <<<<<<<< here and below wont run


Eric
Hall of Famer
Hall of Famer
Posts: 174
Joined: Thu Mar 02, 2017 11:01 pm
Reputation: 90

Re: Get Auto Assemble Edit Form

Post by Eric »

Lefixer seems to be on CE 7.4.1 which is the only version where AutoInject1 is at that position
It's better to get the name of the control, e.g:

Code: Select all

aa=getMemoryViewForm().AutoInject1
aa.doClick()

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 482
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 243

Re: Get Auto Assemble Edit Form

Post by LeFiXER »

Eric wrote:
Mon Oct 24, 2022 8:01 pm
Lefixer seems to be on CE 7.4.1 which is the only version where AutoInject1 is at that position
It's better to get the name of the control, e.g:

Code: Select all

aa=getMemoryViewForm().AutoInject1
aa.doClick()
That's correct. I am, at least for now. Thanks for the tip!

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get Auto Assemble Edit Form

Post by S1N74X »

Eric wrote:
Mon Oct 24, 2022 8:01 pm
Lefixer seems to be on CE 7.4.1 which is the only version where AutoInject1 is at that position
It's better to get the name of the control, e.g:

Code: Select all

aa=getMemoryViewForm().AutoInject1
aa.doClick()
Thank you.
Is there an Overview or a function to get the Names of the available Forms and o Controls ?

Eric
Hall of Famer
Hall of Famer
Posts: 174
Joined: Thu Mar 02, 2017 11:01 pm
Reputation: 90

Re: Get Auto Assemble Edit Form

Post by Eric »

there's the CE sourcecode. You can ready through the .lfm and get the name property of the control you need

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get Auto Assemble Edit Form

Post by S1N74X »

Eric wrote:
Wed Oct 26, 2022 2:17 pm
there's the CE sourcecode. You can ready through the .lfm and get the name property of the control you need
Thx for the answer

Post Reply

Who is online

Users browsing this forum: No registered users