View previous topic :: View next topic |
Author |
Message |
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Tue Aug 19, 2014 6:55 am Post subject: Using Mono structures in aa scripts |
|
|
Sometimes when a game gets patches, the offsets of structure elements change as well
One way to make this easier for you is using the monoAA_GETMONOSTRUCT() function to build an auto assembler struct
(you could use aa command GETMONOSTRUCT as well, but that'll show an annoying popup due to a (de)bug in ce 6.4)
Code: |
{$lua}
return monoAA_GETMONOSTRUCT("PlayerClass", syntaxcheck)
{$asm}
...
mov [registerwithobject+PlayerClass.Health],#100
...
|
_________________
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
Last edited by Dark Byte on Thu Sep 14, 2017 3:02 am; edited 1 time in total |
|
Back to top |
|
|
Hatschi Master Cheater Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Wed Aug 27, 2014 2:16 pm Post subject: |
|
|
Hm it says "..\autorun\monoscript.lua:360: attempt to index global 'monopipe' (a nil value)"
Do I have to dissect mono first or so to use that command?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Wed Aug 27, 2014 3:11 pm Post subject: |
|
|
ah yes, the mono data collector needs to be injected in the target and activated in ce.
Easiest way is just call LaunchMonoDataCollector()
you can call it as often as you like, so
Code: |
{$lua}
LaunchMonoDataCollector()
return monoAA_GETMONOSTRUCT("PlayerClass", syntaxcheck)
{$asm}
...
|
should work too
_________________
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 |
|
|
Belnick Expert Cheater Reputation: 0
Joined: 02 Feb 2012 Posts: 100
|
Posted: Thu Feb 04, 2016 7:22 pm Post subject: |
|
|
Dark Byte wrote: | ah yes, the mono data collector needs to be injected in the target and activated in ce.
Easiest way is just call LaunchMonoDataCollector()
you can call it as often as you like, so
Code: |
{$lua}
LaunchMonoDataCollector()
return monoAA_GETMONOSTRUCT("PlayerClass", syntaxcheck)
{$asm}
...
|
should work too |
what do i open to paste that line into ?
|
|
Back to top |
|
|
h3x1c Master Cheater Reputation: 17
Joined: 27 Apr 2013 Posts: 306
|
Posted: Wed Jul 27, 2016 2:23 pm Post subject: |
|
|
Quick question: Is there a way to close, or "uninject", the Mono Data Collector via the [DISABLE] section of a script? I'm running into sub-scripts in a group still being able to be enabled/disabled even after the group header is disabled since the Mono Data Collector is still running.
I can just set children to hide when not enabled as a visual way to make sure the header is always enabled/disabled, but just wondering about the aforementioned. Thanks!
_________________
|
|
Back to top |
|
|
FauDrei Advanced Cheater Reputation: 4
Joined: 20 Nov 2013 Posts: 69 Location: bachLai
|
Posted: Thu Sep 14, 2017 2:43 am Post subject: Re: Using Mono structures in aa scripts |
|
|
Dark Byte wrote: | Code: |
{$lua}
return monoAA_GETMONOSTRUCT("PlayerClass", syntaxcheck)
{$asm}
...
mov [PlayerClass.Health],#100
...
|
|
...sorry for resurrecting this, but...
If you have mono structure like this in Structure dissect:
...and have the desired Unit instance address in f.e. RCX - how do I get to the Unit.state.hp address in AA?
Is it better to use saved structures from Structure dissect or just monoAA_GETMONOSTRUCT() to "freshly" re-register the desired classes and be "update proof"?
Thanks for your help.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Thu Sep 14, 2017 3:03 am Post subject: |
|
|
first you need to dissect both unit and state (or whatever it's called)
then do something like:
Code: |
push rax
mov rax,[rcx+Unit.state]
lea rax,[rax+State.hp]
mov [hpaddress],rax
pop rax
|
it's recommended to use mono_getmonostruct but often you can also just hardcode it. It only changes when something in those classes change
_________________
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 |
|
|
FauDrei Advanced Cheater Reputation: 4
Joined: 20 Nov 2013 Posts: 69 Location: bachLai
|
Posted: Thu Sep 14, 2017 3:13 am Post subject: |
|
|
Many thanks. (and sorry for duplicating the question in another thread)
EDIT:
Err... one more thing...
Is it possible to stack multiple monoAA_GETMONOSTRUCT() lines in some kind of "registerStructs" lua function in "main" AA script, in a way that you just call "registerStructs" lua function in all other AA (sub)scripts?
I have problem with putting just two monoAA_GETMONOSTRUCT() calls in same lua chunk...
EDIT2:
Some sniffing of experienced lua coder's scripts and some trial and error have solved my problem...
This:
Code: | function registerStructs()
structs = monoAA_GETMONOSTRUCT("Unit", syntaxcheck)
structs = structs..monoAA_GETMONOSTRUCT("UnitPrototype", syntaxcheck)
structs = structs..monoAA_GETMONOSTRUCT("UnitResources", syntaxcheck)
structs = structs..monoAA_GETMONOSTRUCT("UnitState", syntaxcheck)
return structs
end
|
...goes as lua chunk in main AA script, while this
Code: | return registerStructs()
|
...goes (also as lua chunk) in every script that uses mono structures.
Thanks, I have learned something today.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Sep 14, 2017 11:50 am Post subject: |
|
|
FauDrei wrote: | I have problem with putting just two monoAA_GETMONOSTRUCT() calls in same lua chunk... |
if you're trying
Code: | {$lua}
return monoAA_GETMONOSTRUCT(...1)
return monoAA_GETMONOSTRUCT(...2)
{$asm}
| then yeah, you can't return two things, separating them into two parts or concatenating the results should work
Code: | {$lua}
LaunchMonoDataCollector() -- should only need to be done once
return monoAA_GETMONOSTRUCT(...1)
{$asm}
{$lua}
return monoAA_GETMONOSTRUCT(...2)
{$asm}
| or Code: | {$lua}
LaunchMonoDataCollector()
-- concatenate together, not sure if the \r\n is necessary
-- lua immutable strings will cause memory allocations for concatenation...
return monoAA_GETMONOSTRUCT(...1) .. '\r\n' .. monoAA_GETMONOSTRUCT(...2)
{$asm}
| @DB since monoscript.lua uses registerAutoAssemblerCommand shouldn't it also be possible to use just Code: | USEMONO()
GETMONOSTRUCT(...1)
GETMONOSTRUCT(...2)
|
|
|
Back to top |
|
|
MMM-304 Expert Cheater Reputation: 0
Joined: 17 Aug 2020 Posts: 166 Location: Milkey Way
|
Posted: Sun Aug 22, 2021 10:16 pm Post subject: |
|
|
can i get field names using an address instead of class name?
cuz when I try using class name, it says this class doesnt have any fields, but when i use the address, the autoGuess system gives it the same name as of that class, and also populates the fields
|
|
Back to top |
|
|
|