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 


MULTI-LINE AA Script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 943

PostPosted: Tue Mar 12, 2024 5:44 pm    Post subject: MULTI-LINE AA Script This post has 1 review(s) Reply with quote

The mark /! (no another / before, in both AA and Lua block) will act like a normal AA script comment //, ie. remove all text before next new line (CRLF); PLUS any LEADING spaces of next line. The effect is to join the line of the mark and next lines (and more) into a single line. /!+ will left a single space instead.

PURPOSE: make long AOB line more readable

note: the last line of original AA script should not use the mark, as how the match pattern set, mark in last line will not be removed and cause syntax error.


Include and run this script once in your CT before activate an AA script
Code:

if __AA_MULTI_LINE__ then
  unregisterAutoAssemblerPrologue(__AA_MULTI_LINE__)
end

__AA_MULTI_LINE__ = registerAutoAssemblerPrologue(function(s, sc)
  s.Text =s.Text:gsub("(%s*%f[/]/!(%+?)[^\n\r]*[\n\r]%s*)",function(spc, left1spc)
    return left1spc:len()==1 and ' ' or ''
  end)
end, false)


-- debug test to show what happened
-- to test attached ce to process of itself, ie. ce has process address at 400000

Original AA script in a script memory record:
Code:

  globalalloc(___,$1000)
[ENABLE]
  aobscanRegion(test,     /! no space between
    400000+1000,/!+          a space left
    400000+2000,/!           no space between
    ?? )
  ___+10://!   comment still here in PRE AOB
  dq test //!
[DISABLE]

output:
Code:

== PRE AOB pass ==
== before, ie. original aa script text ==
 
  globalalloc(___,$1000)
  aobscanRegion(test,     /! no space between
    400000+1000,/!+          a space left
    400000+2000,/!           no space between
    ?? )
  ___+10://!   comment still here in PRE AOB
  dq test //!
 
== after ==
 
  globalalloc(___,$1000)
  aobscanRegion(test,400000+1000, 400000+2000,?? )
  ___+10://!   comment still here in PRE AOB
  dq test //!
 
==POST AOB pass==
 
globalalloc(___,$1000)
DEFINE(test, 00401000)
___+10:
dq test

_________________
- Retarded.
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 Extensions 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