Jump to content
  • 0

Prevent searching for a value within a range


acl12

Question

Hello everyone, can someone help me with this?
I want to do a range search example:
gg.searchNumber("1;4;59::25,gg.TYPE_DWORD)

And it finds many equal groups, but when I check within the range of these values, there is a value that changes every so often, and it is the value that I want. In the other groups there is a value that is static, but I don't want that, like I can search and deny that it finds, said value, and thus only find 1 single group

gg.searchNumber("1;I don't want this static number to be found;4;59::25,gg.TYPE_DWORD)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Probably not a perfect way to do it but you could search "1;static number you dont want;4;59::25", then refine "59" and edit to whatever you want. Assuming this doesn't crash your game then do the search you want 1;4;59::25 and you should be left with the group you want.

Link to comment
Share on other sites

10 hours ago, sammax71 said:

Probablemente no sea una forma perfecta de hacerlo, pero podría buscar "1; número estático que no desea; 4; 59:: 25", luego refinar "59" y editar lo que desee. Suponiendo que esto no bloquee su juego, haga la búsqueda que desee 1;4;59::25 y debería quedar con el grupo que desea.

Sure, but I use startfuzzy, to edit the value, which I want
I could refine in 59, but several 59 will appear, I explain myself within that range of numbers there is a number that varies a lot, that's why I can't add to the script, otherwise I would, but as of all these ranges only that is the variant, the others are static, i want to search the range but deny those static numbers, so just find the variant number

Link to comment
Share on other sites

1 minute ago, acl12 said:

Claro, pero uso startfuzzy, para editar el valor, que quiero
que pueda refinar en 59, pero aparecerán varios 59, me explico dentro de ese rango de números hay un número que varía mucho, por eso no puedo agregue al script, de lo contrario lo haría, pero a partir de todos estos rangos solo esa es la variante, los otros son estáticos, quiero buscar el rango pero niego esos números estáticos, así que solo busque el número de variante

For example: 

gg.setRanges(gg.REGION_ANONYMOUS)
gg.getResults(gg.getResultsCount())
gg.clearResults()
gg.searchNumber("1889877454;32;static number;0;542423;14237454;2341233::75", gg.TYPE_DWORD)
gg.refineNumber("542423", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

When I refine this number by putting the static number, the value I want is not found, because it is not static
local r1 = gg.getResults(1)

many values come out, so when I apply gg.get Results(1)
it won't get me the number i want
Since the value I want is not here


gg.startFuzzy(gg.TYPE_FLOAT, r1[1].address - 96, r1[1].address - 80)
local c = gg.getResults(2)

 

now I want the static value and all those groups not to be found, only the group with the variant value;
since it is a unique range, and when refining it only gives me a number

Link to comment
Share on other sites

Fuzzy search approach can be used, but the right function to do fuzzy refine search is "searchFuzzy", not "startFuzzy".

Here is an example code to search for a group of values with one or more unknown values, refine for changed values and restore group that includes first changed value: 

local searchedGroup = "123;45;0~~0;6789" -- "0~~0" is for any value
local groupSize = 25
local searchString = searchedGroup .. "::" .. groupSize

gg.setRanges(gg.REGION_ANONYMOUS)
gg.clearResults()
gg.searchNumber(searchString, gg.TYPE_DWORD)
if gg.getResultsCount() == 0 then
  print("No groups have been found")
  os.exit()
end
gg.sleep(1000) -- wait for the value to change (if needed)
gg.searchFuzzy("0", gg.SIGN_FUZZY_NOT_EQUAL) -- refine for changed values
if gg.getResultsCount() == 0 then
  print("No values have changed")
  os.exit()
end
local changedValue = gg.getResults(1)
local valueAddress = changedValue[1].address
gg.clearResults()
-- Search for the group that includes changed value within value's address ± group size 
gg.searchNumber(searchString, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, valueAddress - groupSize, valueAddress + groupSize)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.