Joined: 13 Jun 2022 Posts: 12 Location: South America
Posted: Thu Sep 07, 2023 7:41 pm Post subject: Specify AOB table element
In this code I search for an AOB that generate two results, what I need help with now is simple: in the for command part, it executes the commands only in the second element of the aob, even without specifying it. I've been trying for hours to specify just the first element but it always modifies the second, only the second. I tried something like: "for i, AddressForComboP2 in ipairs(ResultAobComboP2[0]) do" and it didn't work. I'm probably doing something stupid, so I've come to the conclusion that I need a hand with this.
Code:
{$lua}
[ENABLE]
ResultadoAobComboP2 = AOBScan("01 10 D8 00 28")
for i, EnderecoParaComboP2 in ipairs(ResultadoAobComboP2) do
EnderecoParaComboP2 = tonumber(EnderecoParaComboP2, 16)
ValorParaComboP2 = EnderecoParaComboP2 - 17
print(string.format("%X", EnderecoParaComboP2 - 17))
print("valor: ", readByte(ValorParaComboP2))
ValorComboP2 = EnderecoParaComboP2 - 17
break
end
function ModificarComboP2()
writeInteger(ValorComboP2, 1)
print("O valor é: ", readByte(ValorComboP2))
end
if ModificarComboP2T then ModificarComboP2T.destroy(); ModificarComboP2T=nil end
ModificarComboP2T = createTimer()
ModificarComboP2T.interval = 10
ModificarComboP2T.ontimer = ModificarComboP2
[DISABLE]
if ModificarComboP2T then ModificarComboP2T.destroy(); ModificarComboP2T=nil end
Joined: 13 Jun 2022 Posts: 12 Location: South America
Posted: Fri Sep 08, 2023 9:37 am Post subject:
Thanks! I got lost in my own workaround and didn't realize that the for was not necessary. I made some tweaks and it worked thanks to your tips! _________________
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