Jump to content

Question

Posted

Hello im wondering if is there a better way to coding this

i just want to edit every 4th index of the table 

 

  Reveal hidden contents

 

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

Send the script file in this case, it is better

Edited by MAARS
  • 0
Posted

Hope this help.

function lol(new_t, new_i, original_t, original_i, offset, valu)
new_t[new_i].address= original_t[original_i].address + offset
new_t[new_i].flags = gg.TYPE_DWORD
new_t[new_i].value = valu
new_t[new_i].freeze=true
new_t[new_i].freezeType= gg.FREEZE_NORMAL
end

gg.clearResults()
gg.searchNumber("31881667;40;6;1065353216::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL,0, -1, 500)
r = gg.getResults(gg.getResultsCount())
p={}

for i=3, #r, 4 do
p[i]={}
p[i+1]={}
p[i+2]={}
lol(p, i, r, i, 0x20, 4713)
lol(p, i+1, r, i, 0x30, 103706)
lol(p, i+2, r, i, 0x40, 13618)
end

gg.setValues(p)
gg.addListItems(p)

 

  • 0
Posted
  On 5/25/2021 at 8:29 PM, Lover1500 said:

Hope this help.

function lol(new_t, new_i, original_t, original_i, offset, valu)
new_t[new_i].address= original_t[original_i].address + offset
new_t[new_i].flags = gg.TYPE_DWORD
new_t[new_i].value = valu
new_t[new_i].freeze=true
new_t[new_i].freezeType= gg.FREEZE_NORMAL
end

gg.clearResults()
gg.searchNumber("31881667;40;6;1065353216::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL,0, -1, 500)
r = gg.getResults(gg.getResultsCount())
p={}

for i=3, #r, 4 do
p[i]={}
p[i+1]={}
p[i+2]={}
lol(p, i, r, i, 0x20, 4713)
lol(p, i+1, r, i, 0x30, 103706)
lol(p, i+2, r, i, 0x40, 13618)
end

gg.setValues(p)
gg.addListItems(p)

 

Expand  

Genius is what i needed TY SO MUCH

  • 0
Posted
  On 5/25/2021 at 8:29 PM, Lover1500 said:

Hope this help.

function lol(new_t, new_i, original_t, original_i, offset, valu)
new_t[new_i].address= original_t[original_i].address + offset
new_t[new_i].flags = gg.TYPE_DWORD
new_t[new_i].value = valu
new_t[new_i].freeze=true
new_t[new_i].freezeType= gg.FREEZE_NORMAL
end

gg.clearResults()
gg.searchNumber("31881667;40;6;1065353216::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL,0, -1, 500)
r = gg.getResults(gg.getResultsCount())
p={}

for i=3, #r, 4 do
p[i]={}
p[i+1]={}
p[i+2]={}
lol(p, i, r, i, 0x20, 4713)
lol(p, i+1, r, i, 0x30, 103706)
lol(p, i+2, r, i, 0x40, 13618)
end

gg.setValues(p)
gg.addListItems(p)

 

Expand  

i need some further help

 

how to retrive the value of an offset address?

 


gg.searchNumber("19811;1065353216;10616;10606;10611::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 5)
     r = gg.getResults(gg.getResultsCount())
    
     t = 
{
    {
                address = r[1].address - 0x8

    }
}
    p = {
    {
                val = t[1].value
    }
}

print(' value: ', p[1].value)

 

  • 0
Posted
  On 5/26/2021 at 10:19 AM, hsusudhbsjwhdhdgsj said:

but can not use as variable and will return nil

Expand  

its for table

t = {}
t[1] = {}
t[1].address = 0x18004030
t[1].flags = gg.TYPE_DWORD

t = gg.getValues(t)
print(t)

or

t = {address = 0x18004030,flags = gg.TYPE_DWORD}
t = gg.getValues(t)
print(t)

 

  • 0
Posted (edited)

  

  On 5/26/2021 at 10:23 AM, Lover1500 said:

its for table

t = {}
t[1] = {}
t[1].address = 0x18004030
t[1].flags = gg.TYPE_DWORD

t = gg.getValues(t)
print(t)

or

t = {address = 0x18004030,flags = gg.TYPE_DWORD}
t = gg.getValues(t)
print(t)

 

Expand  

i've tried but is not giving me any result

i just need to retrive the value of the new address and use it to search again

 

gg.searchNumber("19811;1065353216;10616;10606;10611::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 5)
     r = gg.getResults(gg.getResultsCount())

t = {}
t[1] = {}
t[1].address = r[1].address - 0x8
t[1].flags = gg.TYPE_DWORD

t = gg.getValues(t)

AccID = t[1].value 

gg.searchNumber("AccID;40;6;1065353216::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 5)
     r = gg.getResults(gg.getResultsCount())

for some reason using AccID = r[1].value is working but i need the new address value that is t[1].address = r[1].address - 0x8 and is giving nil result using t[1].value 

Edited by hsusudhbsjwhdhdgsj
  • 0
Posted (edited)

  

  On 5/25/2021 at 8:29 PM, Lover1500 said:

Hope this help.

function lol(new_t, new_i, original_t, original_i, offset, valu)
new_t[new_i].address= original_t[original_i].address + offset
new_t[new_i].flags = gg.TYPE_DWORD
new_t[new_i].value = valu
new_t[new_i].freeze=true
new_t[new_i].freezeType= gg.FREEZE_NORMAL
end

gg.clearResults()
gg.searchNumber("31881667;40;6;1065353216::", gg.TYPE_DWORD, false, gg.SIGN_EQUAL,0, -1, 500)
r = gg.getResults(gg.getResultsCount())
p={}

for i=3, #r, 4 do
p[i]={}
p[i+1]={}
p[i+2]={}
lol(p, i, r, i, 0x20, 4713)
lol(p, i+1, r, i, 0x30, 103706)
lol(p, i+2, r, i, 0x40, 13618)
end

gg.setValues(p)
gg.addListItems(p)

 

Expand  

actually one last thing how to restore the original_t[original_i].address + offset value that got changed on lol(p, i, r, i, 0x20, 4713)? 

 

i've tried everythink i know to revert the changes back to original state value but im lost

Edited by hsusudhbsjwhdhdgsj

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.