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 


Is there a way to open a new AA window with text?

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

Joined: 25 Sep 2011
Posts: 264

PostPosted: Mon Jan 27, 2020 7:46 pm    Post subject: Is there a way to open a new AA window with text? Reply with quote

I've been working on my mono lua functions more and want to create something that opens a new AutoAssembler window and set the text, or to add something to the templates menu that will change the text Is there an easy way to do that?

Here's what the generated hook looks like FYI:

Code:
define(hook,"CryingSuns.PlayerStatus:BattleshipState:AddAuxiliarySystems")
define(bytes,55 48 8B EC 56)

[enable]

assert(hook, bytes)
alloc(newmem,$1000, hook)

{
  RCX: BattleshipState (this)
  RDX: string[] _auxSystemIds

  Returns (RAX) System.Void
}

newmem:
  // original code
  push rbp
  mov rbp,rsp
  push rsi
  jmp hook+5

hook:
  jmp newmem

[disable]

hook:
  db bytes

dealloc(newmem)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Jan 28, 2020 2:19 am    Post subject: Reply with quote

Next version has a createAutoAssemblerForm, for now you can use:
Code:

function createAutoAssemblerForm(text)
  getMemoryViewForm().AutoInject1.DoClick()

  for i=0,getFormCount()-1 do --this is sorted from z-level. 0 is top
    local f=getForm(i)

    if getForm(i).ClassName=='TfrmAutoInject' then
      f.assemblescreen.Lines.Text=text
      return f
    end
  end
end




for the template:
Code:

if jgtemplateid then
  unregisterAutoAssemblerTemplate(jgtemplateid)
  jgtemplateid=nil
end
jgtemplateid=registerAutoAssemblerTemplate("Jgoemat's template", function(script, sender)
  --perhaps add in a scan for [enable]/[disable] but just an example so meh. (But if you do, remember that inserting lines will also change the position of enable/disable)

  script.add("//!!!!!Code added by JGoemat's template!!!!!");
  script.add('define(hook,"CryingSuns.PlayerStatus:BattleshipState:AddAuxiliarySystems")')
  script.add('define(bytes,55 48 8B EC 56)')
  script.add('Some other stuff, you get the idea...')

  --alternatively you could work on the script.Text property as well
  script.text=script.text..[[
added by
a multiline addition
yeeeeh
]]

script.insert(0,'this line was added last')
end)

_________________
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
jgoemat
Master Cheater
Reputation: 23

Joined: 25 Sep 2011
Posts: 264

PostPosted: Tue Jan 28, 2020 9:30 am    Post subject: Reply with quote

Awesom, thanks! I’ll try that tonight.

... later ...

Worked like a charm! I posted a link to my github repo with the table and supporting scripts in the extensions forum.
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