Jump to content
  • 0

Just like we change the address "value" can we also change the address "name" while using the script?


Question

Posted

Just like we change the address "value" can we also change the address "name" while using the script?

gg.clearResults()
gg.searchNumber("8243116118139470284", 32)
gg.refineNumber("8243116118139470284", 32)
local t = gg.getResults(10)

for i,v in pairs(t) do
  
t[i].address = t[i].address - 0x30
t[i].flags = 1
t[i].value = 0
t[i].freeze = false

gg.setValues(t)
end
local t = gg.getResults(10)

for i,v in pairs(t) do
  
t[i].address = t[i].address + 0x10
t[i].flags = 16
t[i].value = 48
t[i].freeze = true

gg.setValues(t)
end
gg.clearResults()

20231231_101235.png

Recommended Posts

  • 0
Posted
On 1/1/2024 at 11:12 PM, MarioRossi93i said:

set t[i].name then use gg.addListItems() after gg.setValues()

thanks!

  • 0
Posted
On 1/1/2024 at 11:12 PM, MarioRossi93i said:

set t[i].name then use gg.addListItems() after gg.setValues()

gg.clearResults()

gg.searchNumber("-7041975695332343808", 32)

gg.refineNumber("-7041975695332343808", 32)

local t = gg.getResults(10)

gg.clearResults()

 

e = {1}

b = {}

 

for i,v in pairs(e) do

 

 ------------- first step [doesn't working]

table.insert(b, {address = t[1].address - 0x0; t[1].name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

------------- second step [doesn't working]

table.insert(b, {address = t[1].address - 0x0;name = t[1].name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

------------- third step [doesn't working]

table.insert(b, {address = t[1].address - 0x0;name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

can you also give me an example how to work this function in this command?

  • 0
Posted
7 hours ago, _yourram said:

gg.clearResults()

gg.searchNumber("-7041975695332343808", 32)

gg.refineNumber("-7041975695332343808", 32)

local t = gg.getResults(10)

gg.clearResults()

 

e = {1}

b = {}

 

for i,v in pairs(e) do

 

 ------------- first step [doesn't working]

table.insert(b, {address = t[1].address - 0x0; t[1].name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

------------- second step [doesn't working]

table.insert(b, {address = t[1].address - 0x0;name = t[1].name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

------------- third step [doesn't working]

table.insert(b, {address = t[1].address - 0x0;name = 'Ram';flags = 16; value = '100'}) 

end

 

gg.setValues(t)

gg.addListItems(t)

b = {}

 

can you also give me an example how to work this function in this command?

@MarioRossi93i bruh reply me as soon as possible because my script is waiting for your reply :!

  • 0
Posted
local gg = gg
local s = 8243116118139470284
local offset = { 0x30, 0x10 }
local r = {}

gg.clearResults()
gg.searchNumber(s,0x20)

if gg.getResultCount()==0 then
    print('No results found.')
    os.exit()
end

local t = gg.getResults(10)

for i,v in ipairs(t) do

    r = {
        [1] = {
            address = v.address-offset[1],
            flags = 0x1,
            value = 0,
            name = 'Ram '..i..',1'
        },
        [2] = {
            address = v.address+offset[2],
            flags = 0x10,
            value = 0x30,
            freeze = true,
            name = 'Ram '..i..',2'
        },
    }
    gg.setValues(r)
    gg.addListItems(r)
end
gg.clearResults()

this should works

  • 0
Posted

@MarioRossi93i sorry but can we can't change "address name" in this?

gg.clearResults()

gg.searchNumber("-7041975695332343808", 32)

gg.refineNumber("-7041975695332343808", 32)

local t = gg.getResults(10)

gg.clearResults()

e = {1}

b = {}

for i,v in pairs(e) do

table.insert(b, {address = t[1].address - 0x0;flags = 16; value = '100'}) 

end

gg.setValues(t)

gg.addListItems(t)

b = {}

 

 

  • 0
Posted
55 minutes ago, _yourram said:

in this

It's done exactly as in his example. For your code it may be: 

gg.clearResults()
gg.searchNumber("-7041975695332343808", 32)
gg.refineNumber("-7041975695332343808", 32)
local results = gg.getResults(10)
gg.clearResults()
local values = {}
for i, v in ipairs(results) do
  values[i] = {address = v.address, flags = 16, value = "100", name = "Custom name"}
end
gg.setValues(values)
gg.addListItems(values)
  • 0
Posted
local gg = gg
local s = -7041975695332343808

gg.clearResults()
gg.searchNumber(s,0x20)

if gg.getResultCount()==0 then
    print('No results found.')
    os.exit()
end

local t = gg.getResults(10)

for i,v in ipairs(t) do
  v.flags = 0x10
  v.value = 0x64
  v.name = 'text'
  gg.setValues({v})
  gg.addListItems({v})
end
gg.clearResults()

I suggest you read the gameguardian help to better understand how it works

  • 0
Posted

@CmP I noticed that you assigned the values first and then called setValues and addListItems once after the for loop, but I instead made one call per loop. the question is is your script faster or is it the same in your opinion? Thanks in advance for your reply, best wishes for a great 2024!

  • 0
Posted

GG API function calls such as "setValues" and "addListItems" are quite expensive in comparison to several lua instructions, so less calls will be more efficient in almost all cases. But the difference may be noticeable only when many values are set/added, for 10 values it won't be.

  • 0
Posted
1 hour ago, CmP said:

It's done exactly as in his example. For your code it may be: 

gg.clearResults()
gg.searchNumber("-7041975695332343808", 32)
gg.refineNumber("-7041975695332343808", 32)
local results = gg.getResults(10)
gg.clearResults()
local values = {}
for i, v in ipairs(results) do
  values[i] = {address = v.address, flags = 16, value = "100", name = "Custom name"}
end
gg.setValues(values)
gg.addListItems(values)

@CmP thanks, but still i have a question how can I edit multiple values when using this?

Example ↓

gg.clearResults()

gg.searchNumber("-7041975695332343808", 32)

gg.refineNumber("-7041975695332343808", 32)

local results = gg.getResults(10)

gg.clearResults()

local values = {}

for i, v in ipairs(results) do

values[i] = {address = v.address + 0x10, flags = 16, value = "100", name = "Health"}

end

local values = {}

for i, v in ipairs(results) do

values[i] = {address = v.address - 0x16, flags = 16, value = "-140", name = "Power"}

end

gg.setValues(values)

gg.addListItems(values)

  • 0
Posted
55 minutes ago, _yourram said:

@CmP thanks, but still i have a question how can I edit multiple values when using this?

Example ↓

gg.clearResults()

gg.searchNumber("-7041975695332343808", 32)

gg.refineNumber("-7041975695332343808", 32)

local results = gg.getResults(10)

gg.clearResults()

local values = {}

for i, v in ipairs(results) do

values[i] = {address = v.address + 0x10, flags = 16, value = "100", name = "Health"}

end

local values = {}

for i, v in ipairs(results) do

values[i] = {address = v.address - 0x16, flags = 16, value = "-140", name = "Power"}

end

gg.setValues(values)

gg.addListItems(values)

let it go i figured out how to do it 🙂

  • 0
Posted
7 hours ago, _yourram said:

do you know how to run the "changed as search result" command in a script?

There is no API function for that. If you need it for values that were changed by your script, that can be implemented in the script itself.

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.