This is my point, it does meet the requirement because valStart gets incremented by 0x250 before the if statement will check and compare valStart. If i put the if statement at the top, the loop will index once more which is a waste to do because we already know that the value has reached the condition when valStart was incremented. So for that reason i placed the if statement at the bottom.
dex = {}
for i = 1, loop do
if valStart >= range[3]["end"] then
print(i, "Condition: "..string.format("%x", valStart), string.format("%x", valEnd))
break end
print(i, "Current: "..string.format("%x", valStart),"End address: "..string.format("%x", valEnd))
dex[#dex + 1] = {address = valStart, flags = gg.TYPE_QWORD}
valStart = valStart + 0x250
end
Look like this:
It will increment loop once more and then do the break. At the top.
But here i do if statement at the botton before loop index increments:
dex = {}
for i = 1, loop do
print(i, "Current: "..string.format("%x", valStart),"End address: "..string.format("%x", valEnd))
dex[#dex + 1] = {address = valStart, flags = gg.TYPE_QWORD}
valStart = valStart + 0x250
if valStart >= range[3]["end"] then
print(i, "Condition: "..string.format("%x", valStart), string.format("%x", valEnd))
break end
end