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 


Cheat Engine Forum Index
PostGo back to topic
panraven
Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008
Posts: 958

PostPosted: Tue Mar 12, 2024 5:44 pm    Post subject: MULTI-LINE AA Script

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
Post reviews:   Approve 1
Author Review
AylinCE
Review: Approve
Post reference:
ReviewPosted: Fri Mar 29, 2024 6:08 am

thanks ..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites