Jump to content
  • 0

how to go to pointer in fast way


XkPP

Question

so i made the code go to the pointer but if the result reaches 1k or more it will take long to load the pointer, is there any way to speed it up?

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for i in ipairs(valueRes) do
valueHex = gg.getValues(valueRes)
valueHex[i].address = valueHex[i].value 
valueResFi = gg.getValues(valueHex)
end
gg.loadResults(valueResFi)
--gotoPointer

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

local count = gg.getResultsCount()
local valueRes = gg.getResults(count)
local valueResFi = {}
for i, v in ipairs(valueRes) do
  valueResFi[i] = {address = v.value, flags = v.flags}
end
gg.loadResults(valueResFi)

This? Did not try to touch to much the variables.

 

Link to comment
Share on other sites

On 1/19/2023 at 4:59 AM, XkPP said:

so i made the code go to the pointer but if the result reaches 1k or more it will take long to load the pointer, is there any way to speed it up?

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for i in ipairs(valueRes) do
valueHex = gg.getValues(valueRes)
valueHex[i].address = valueHex[i].value 
valueResFi = gg.getValues(valueHex)
end
gg.loadResults(valueResFi)
--gotoPointer

 

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for i in pairs(valueRes) do

valueHex[i].address = valueHex[i].value ------> u don't need to use getValues inside the loop (it makes the script a little bit slow use it only if u gonna do some operations like +0x4 then somthing else then somthing else)

end
valueHex = gg.getValues(valueRes)
---------------------------------------------------------------
u can use this method since u use 2 tables : 
for k,v in ipairs(valueRes)
valueHex[#valueHex+1].address =  valueHex[k].value -----------> ([#valueHex+1] if the table is empty {} to prevent error)
end
valueHex = gg.getValues(valueRes)

Link to comment
Share on other sites

3 hours ago, XEKEX said:

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for i in pairs(valueRes) do

valueHex[i].address = valueHex[i].value ------> u don't need to use getValues inside the loop (it makes the script a little bit slow use it only if u gonna do some operations like +0x4 then somthing else then somthing else)

end
valueHex = gg.getValues(valueRes)
---------------------------------------------------------------
u can use this method since u use 2 tables : 
for k,v in ipairs(valueRes)
valueHex[#valueHex+1].address =  valueHex[k].value -----------> ([#valueHex+1] if the table is empty {} to prevent error)
end
valueHex = gg.getValues(valueRes)

like this you mean? but raises error:

attempt to get length of a nil value (global 'valueHex')

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for k,v in ipairs(valueRes) do
valueHex[#valueHex+1].address =  valueHex[k].value
end
valueHex = gg.getValues(valueRes)
gg.loadResults(valueHex)

 

Link to comment
Share on other sites

3 hours ago, XkPP said:

like this you mean? but raises error:

attempt to get length of a nil value (global 'valueHex')

local valueRes = gg.getResults(gg.getResultCount())
gg.removeResults(valueRes)
for k,v in ipairs(valueRes) do
valueHex[#valueHex+1].address =  valueHex[k].value
end
valueHex = gg.getValues(valueRes)
gg.loadResults(valueHex)

 

you need to declaire it befot using it :
valueHex = {}
the scrip body
--

Link to comment
Share on other sites

On 1/21/2023 at 10:37 AM, XkPP said:

I'm confused...

can you post the complete code so I can understand


 

local valueRes = gg.getResults(gg.getResultCount())
local valueHex = {}
for k,v in ipairs(valueRes) do
valueHex[#valueHex+1].address =  valueRes[k].value
end
valueHex = gg.getValues(valueHex)
gg.removeResults(valueRes)
gg.loadResults(valueHex)

 

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.