Posted: Mon Oct 28, 2019 1:09 pm Post subject: Issue with AoB values and If statements.
Code:
local AoB = AOBScan("14 00 00 13 00 22 00 00 01 41 01 00 00 00 00 00 00")
if (AoB == nil or AoB.Count > 40) then -- Ends function earlier if the AoB was not found, or if multiply aobs were found.
return
end
if (AoB.count > 0) then
local ArrowRange1 = AoB[0]
end
if (AoB.Count > 1) then
local ArrowRange2 = AoB[1]
end
if (AoB.Count > 2) then
local ArrowRange3 = AoB[2]
end
if (AoB.Count > 3) then
local ArrowRange4 = AoB[3]
end
I cannot figure out what I am doing wrong here. When I execute the script the values aren't writing to the first 4 results from the AOB scan. If I try to print "ArrowRange1" inside the IF statement the address prints but if I try to print it outside of the IF statement nothing is printed. Same thing with all 4 of them. I'd love to know what I am doing wrong here. it's annoying me
Also if anyone has a better way of writing this script I'd like to learn it. The reason I had to put these within IF statements is because the script wont run if there are less results than anticipated. For example if the scan only finds 3 addresses then the script wont work because Im trying to assign AoB[3] to ArrowRange4. Thank you ))
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