Posted: Wed May 22, 2019 7:12 pm Post subject: Script Header to change child
Code:
[]Armor <Script>
[]Armor H Val: X
[] Thing One Val: X
[] Thing Two Val: X
So I have a script with a header in it and I want to use lua to change "ArmorH" to 1 on activation and 0 on deactivation. I currently have now clue how to target "ArmorH" through the script however since it has no address
Update:
I have tried a script but was unsuccessful
Code:
{$lua}
if sytaxcheck then return end
[ENABLE]
local list = getAddressList()
mem = list.getMemoryRecordByDescription('Armor')
mem.Value = 1
[DISABLE]
mem.Value = 0
Closer update:
Code:
{$lua}
if sytaxcheck then return end
[ENABLE]
local list = getAddressList()
mem = list.getMemoryRecordByDescription('Thing One')
mem.Value = 1
[DISABLE]
mem.Value = 0
Works fine, but when I add memT which is Thing Two to the mix, Thing Two will not turn into a 1. The only difference between them is their pointer but I can manually set the value
the variable memrec refers to the current memory record/script and memory records have a Child array property of their child records so from the Armor Script memrec.Child[0].Child[1] would refer to Thing Two. Do remember though that {$lua} is more of a meta-programming feature in AA scripts so it runs before the AA code has ie, before the script has fully enabled or disabled, you can use a timer with an arbitrary delay to wait until the script has been enabled (optionally with an actual check of the memory record if you expect an aobscan to take a long time).
But yeah, explicitly getting the memory record from the Address List using any of the three methods can also work _________________
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