Jump to content
  • 0

Slowing Group search


Yelay12

Question

Posted

When i search as groupsearch,I get results is slower than normal search.

Can i search as twice this two value and do offset with offset distance.

if i know this two values and offset distance.How to write my script instead of group search. Please help with your great experience.

4 answers to this question

Recommended Posts

Posted
21 hours ago, CmP said:

Then it's reasonable to just search either first or second value and filter only desired results that have other value at needed offset. Something like the following: 

local firstValue = 210.0
local secondValue = 30.0
local offset = 12

gg.clearResults()
gg.searchNumber(firstValue, gg.TYPE_DOUBLE)
local firstValues = gg.getResults(gg.getResultsCount())
local secondValues = {}
for i, v in ipairs(firstValues) do
  secondValues[i] = {address = v.address + offset, flags = gg.TYPE_DOUBLE}
end
secondValues = gg.getValues(secondValues)
local targetResults = {}
local index = 1
for i = 1, #firstValues do
  if secondValues[i].value == secondValue then
    targetResults[index] = firstValues[i]
    targetResults[index + 1] = secondValues[i]
    index = index + 2
  end
end
gg.loadResults(targetResults)

Thank you very very much.I'm finding that script.

Posted

What are the values? How many search results do you get when searching the values separately (i.e. new search for first value in desired ranges - X results, same for second value - Y results)? What is the offset between the values? Which option will work better for your case can be estimated only with knowledge of the details.

Posted
5 hours ago, CmP said:

What are the values? How many search results do you get when searching the values separately (i.e. new search for first value in desired ranges - X results, same for second value - Y results)? What is the offset between the values? Which option will work better for your case can be estimated only with knowledge of the details.

My values are first is 210 and second is 30 TYPE_DOUBLE each. Offset distance between these values is 12 decimal number.X searching results for first will be approximately 500 and Y results for second get probably approximately 300 results.These results are not same one time to another time.Resultscount can be change every time. Please can you help me for this case.

Posted

Then it's reasonable to just search either first or second value and filter only desired results that have other value at needed offset. Something like the following: 

local firstValue = 210.0
local secondValue = 30.0
local offset = 12

gg.clearResults()
gg.searchNumber(firstValue, gg.TYPE_DOUBLE)
local firstValues = gg.getResults(gg.getResultsCount())
local secondValues = {}
for i, v in ipairs(firstValues) do
  secondValues[i] = {address = v.address + offset, flags = gg.TYPE_DOUBLE}
end
secondValues = gg.getValues(secondValues)
local targetResults = {}
local index = 1
for i = 1, #firstValues do
  if secondValues[i].value == secondValue then
    targetResults[index] = firstValues[i]
    targetResults[index + 1] = secondValues[i]
    index = index + 2
  end
end
gg.loadResults(targetResults)

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.