Jump to content
  • 0

Read value in offset


1x1
 Share

Question

Hi there.

 

I wanna know how to read values when doing offset.

 

here is a code i find:

local t = gg.getResults(1)
for i,v in pairs(t) do
   
t[i].address = t[i].address + 0x4
t[i].flags = 4
t[i].value = 7
t[i].freeze = false
  
gg.setValues(t)
gg.addListItems(t)
end

This is the part of offset, using 1 results to goto into a memory viewer to edit.

 

But the 1 thing i really need.

Is to read the offset value. Doing offset are static in this game. C++ Alloc

 

I wanna do offset then gg.alert('The offset value is 3 (DWORD)')

 

Then i wanna make it goes something like this

local t = gg.getResults(1)
for i,v in pairs(t) do
   
t[i].address = t[i].address + 0x4
t[i].flags = 4
t[i].value = 7
t[i].freeze = false
 
if t[i].address + 0x4 == "1234" then
gg.setValues(t)
    else
    gg.alert('The offset value is not 1234, meaning this is a trap value!')
    end
gg.addListItems(t)
end

it only edit the offset if the target offset is the correct Value. if the value is not offset target value. Then it will ignore then go to another results.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

try this?

local results = gg.getResults(1)

local offsetValue = {}
local check = "1234"

for i, v in pairs (results) do 
   offsetValue[i] = {address = v.address + 0x4, flags = gg.TYPE_DWORD}
   end
offsetValue = gg.getValues(offsetValue)

for i, v in pairs (offsetValue) do 
    if v.value == check then
    gg.setValues({
          {address = offsetValue[1].address, flags = 4, value = 7}
     })
    else
    gg.alert("Wrong value = "..offsetValue[1].value.."\nCorrect Value = "..check)
    end
end

 

Edited by MonkeySAN
Link to comment
Share on other sites

  • 1

maybe like this?

...

for i, v in pairs (offsetValue) do 
    if v.value == check then
    gg.setValues({
          {address = offsetValue[i].address, flags = 4, value = 7}

...

those codes wasnt mine actually..its from someone else.

@CmP i think?

Edited by MonkeySAN
Link to comment
Share on other sites

  • 0
2 hours ago, MonkeySAN said:

try this?

local results = gg.getResults(1)

local offsetValue = {}
local check = "1234"

for i, v in pairs (results) do 
   offsetValue[i] = {address = v.address + 0x4, flags = gg.TYPE_DWORD}
   end
offsetValue = gg.getValues(offsetValue)

for i, v in pairs (offsetValue) do 
    if v.value == check then
    gg.setValues({
          {address = offsetValue[1].address, flags = 4, value = 7}
     })
    else
    gg.alert("Wrong value = "..offsetValue[1].value.."\nCorrect Value = "..check)
    end
end

 

yes, thank you very much.

Link to comment
Share on other sites

  • 0
2 hours ago, MonkeySAN said:

try this?

local results = gg.getResults(1)

local offsetValue = {}
local check = "1234"

for i, v in pairs (results) do 
   offsetValue[i] = {address = v.address + 0x4, flags = gg.TYPE_DWORD}
   end
offsetValue = gg.getValues(offsetValue)

for i, v in pairs (offsetValue) do 
    if v.value == check then
    gg.setValues({
          {address = offsetValue[1].address, flags = 4, value = 7}
     })
    else
    gg.alert("Wrong value = "..offsetValue[1].value.."\nCorrect Value = "..check)
    end
end

 

1 more things, sry if i annoy.

 

the code you send me is very good, but i forget to say with multiple offset.

 

If is 1234 then is going to multiple offset.

 

Just like how your code works. It check the first results then read the target offset if is 1234.

 

same like this but with multiple offset, example, Gems, Energy, Coin, Diamond, Golden

Link to comment
Share on other sites

  • 0
39 minutes ago, MonkeySAN said:

maybe like this?

...

for i, v in pairs (offsetValue) do 
    if v.value == check then
    gg.setValues({
          {address = offsetValue[i].address, flags = 4, value = 7}

...

those codes wasnt mine actually..its from someone else.

@CmP i think?

Is perfectly working good!! thanks you very much bro

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.