panraven Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008 Posts: 957
|
Posted: 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. |
|