Jump to content
  • 0

Nearby Search


HorridModz
 Share

Question

My goal in a script is to find a value, then edit an address 2 values below the address of the value I found. In the script, I find the value. But I don't know how to edit the one 2 below it.

Normally, there are 3 ways: To click the address and select "goto", then scroll 2 down, to hold down on the address and select search nearby, then search nearby with only the after box checked and a distance of 8 (I don't know why it is 8 and not 2, but ignore that) or to copy the address and to manually search nearby with the address you copied.

All of these fail in scripts: You cannot goto an address in a script, you cannot hold down and click an option on an address, and you cannot copy and paste.

So, is there any way to do this? Or am I screwed?

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
19 minutes ago, HorridModz said:

My goal in a script is to find a value, then edit an address 2 values below the address of the value I found. In the script, I find the value. But I don't know how to edit the one 2 below it.

Normally, there are 3 ways: To click the address and select "goto", then scroll 2 down, to hold down on the address and select search nearby, then search nearby with only the after box checked and a distance of 8 (I don't know why it is 8 and not 2, but ignore that) or to copy the address and to manually search nearby with the address you copied.

All of these fail in scripts: You cannot goto an address in a script, you cannot hold down and click an option on an address, and you cannot copy and paste.

So, is there any way to do this? Or am I screwed?

Do your search to get the nearby value, lets say it gives one result 8 bytes above the target

 

local results = gg.getResults(1)
results[1].address = results[1].address + 8 --Add the distance to your desired address
results[1].flags = gg.TYPE_DWORD --Set the flag for the value you will be editing
results = gg.getValues(results)

 

Link to comment
Share on other sites

  • 0
27 minutes ago, BadCase said:

Do your search to get the nearby value, lets say it gives one result 8 bytes above the target

 

local results = gg.getResults(1)
results[1].address = results[1].address + 8 --Add the distance to your desired address
results[1].flags = gg.TYPE_DWORD --Set the flag for the value you will be editing
results = gg.getValues(results)

 

Now, where does the value go? @BadCaseWhen I run this script, nothing happens. I am guessing that the value is stored in the results list, and I have to somehow add this to saved values?

Link to comment
Share on other sites

  • 0
local results = gg.getResults(1)
results[1].address = results[1].address + 8 --Add the distance to your desired address
results[1].flags = gg.TYPE_DWORD --Set the flag for the value you will beresults
results[1].value = desiredValueHere
gg.setValues(results)

 

11 minutes ago, HorridModz said:

Now, where does the value go? @BadCaseWhen I run this script, nothing happens. I am guessing that the value is stored in the results list, and I have to somehow add this to saved values?

 

Link to comment
Share on other sites

  • 0
1 hour ago, HorridModz said:

@BadCaseMy script is finally done! The only thing I need is to freeze these values somehow.

do 

results[1].freeze = true

when setting the values and

gg.addListItems(results) 

to set the values instead of

gg.setValues(results)

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.