Jump to content

Question

Posted

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?

11 answers to this question

Recommended Posts

  • 0
Posted
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)

 

  • 0
Posted
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?

  • 0
Posted
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?

 

  • 0
Posted
3 minutes ago, BadCase said:

look at the code at the top of the post

Oops, thanks

  • 0
Posted
5 hours ago, HorridModz said:

Oops, thanks

My fault, I pressed quote after i pasted the code lol

  • 0
Posted

@BadCaseThis is working perfectly, and my script is almost done - thanks a lot! But how would I freeze these values?

  • 0
Posted

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

  • 0
Posted
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)

  • 0
Posted

Tysm, I will try! I've been so excited the past 3 hours! Sorry if I pinged too much.

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