Jump to content
  • 0

Read value in offset


1x1

Question

Posted

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.

5 answers to this question

Recommended Posts

Posted

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

 

Posted
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.

Posted
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

Posted

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?

Posted
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

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.