Jump to content
  • 0

How to group values to edit in a search?


ThienTeakee
 Share

Question

Hi guys, I'm new at GG

I have a script like this

gg.clearResults()

gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber('1.014.350.479;1.012.202.996;1.083.179.008;1.050.253.722;1.031.127.695;1.065.353.216;1.065.353.216;1.067.282.596:61', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(5000)

I want to change "1.014.350.479" to "1.011.011.011" and "1.050.253.722;1.031.127.695" to "1". Because I only know how to edit all of them with "editAll()", not know how to group them like this.

Thanks for your help

Link to comment
Share on other sites

Recommended Posts

  • 0
  • Administrators
4 minutes ago, CmP said:

it does not really matter when results count is relatively small.

Depends on the specific situation. For example, if the code needs to be executed within a certain time frame or 30 such code sections must be executed. In this case, even for 100 elements there can be a noticeable difference.

Link to comment
Share on other sites

  • 0
14 minutes ago, Enyby said:

You can make it is faster, by cache get 'value' from inner table:


local results = gg.getResults(5000)
for i, v in ipairs(results) do
  local value = v.value
  if value == 1014350479 then
    v.value = 1011011011
  elseif value == 1050253722 or value == 1031127695 then
    v.value = 1
  else
    results[i] = nil
  end
end
gg.setValues(results)
results = nil

 

the previous one was already gave a big improvement in my script.

lots new things i had learned today from this topic only.

Link to comment
Share on other sites

  • 0
7 minutes ago, zam535582 said:

so i had this code = 0;2;800;0::13

want to change = 2;800 

i want to give user to change =  2 to any value they like

but change = 800 to a fixed value.

how can i do that??

use prompt for help and do the same as the iterate, just v.value = prompt[1]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.