q1) Generally, it's what you expect it to be such that everything works out. The only exception I can think of right now is {$lua} blocks which are more or less a preprocessor directive- whatever string those blocks return is substituted as AA code.
define(...), aobscan(...), alloc(...), and label(...) happen before most stuff. Instructions get assembled and written to memory, and registersymbol(...) happens eventually.
The script first goes through a syntax check that is pretty much a dry run (e.g. doesn't allocate or modify anything). Then it actually does what it's suppose to do.
If you're talking about the order the game executes instructions, that depends entirely on what code you've written. e.g. something basic like this:
Code:
alloc(newmem,1024)
injectionpoint:
jmp newmem
return:
newmem:
mov eax,4
jmp return
The game will eventually execute the code that was at "injectionpoint" by itself on its own terms (you can't force it). When it does, the new code the script wrote to the injection point will jump to allocated memory, run the code there ("mov eax,4"), then jump back after the injection point. The game then continues on its merry way as normal.
q2) There exists code at the injection point. If there weren't, the game would never run the injection point, and your code injection is useless.
You need space to write your code. It's not common there's enough space at the injection point for you to do what you want (it's not beginner-friendly to do that correctly, either). So, the AA script allocates some memory in the target process, and you can do whatever you want there.
q3) I remember there being some way of accessing Lua variables in AA scripts, but that example you posted wouldn't work regardless. The Lua value would be converted to a string and substituted in ("fld [55.5]" doesn't make sense). You might want something like this:
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