Jump to content
  • 0

Using Offset and Adding to Value


sammax71

Question

I have my group search which gets me to using offset from one of the values to get me to the address I want to edit. I can edit the address but what I really want to do is to add to that value but I can't work out how to do it.

Here is a bit of my script if it helps:

gg.searchNumber("1D;2D;3E;4F;5E;6F::50", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1, 0)

gg.refineNumber("6", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)

r = gg.getResults(1)

local t = {}

t[1] = {} t[1].address = r[1].address + 0X14

t[1].flags = gg.TYPE_DWORD

t[1].value = 1000

gg.setValues(t)

gg.addListItems(t)

 

So the t[1].value I really want to be +1000 but just adding the + doesn't seem to work.

Any help is appreciated.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Use "getValues" function to get value at desired address, then modify "value" field in returned table as needed and call "setValues" function. For example: 

local result = gg.getResults(1)
local val = {}
val[1] = {address = result[1].address + 0x14, flags = gg.TYPE_DWORD}
val = gg.getValues(val)
val[1].value = val[1].value + 1000
gg.setValues(val)
Link to comment
Share on other sites

34 minutes ago, CmP said:

Use "getValues" function to get value at desired address, then modify "value" field in returned table as needed and call "setValues" function. For example: 


local result = gg.getResults(1)
local val = {}
val[1] = {address = result[1].address + 0x14, flags = gg.TYPE_DWORD}
val = gg.getValues(val)
val[1].value = val[1].value + 1000
gg.setValues(val)

Beautiful. Works perfectly. Thank you so much for your help. That's another thing I've learned 👍🏻

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.