Jump to content
  • 0

how to fix to quickly edit value with offset


XkPP

Question

I found an important value of more than 5k results but this technique is slow to edit is there any other code that speeds up editing?

___

local edt = gg.getResults(gg.getResultCount())
for i,v in pairs(edt) do
edt[i].address = edt[i].address + 8
edt[i].flags = gg.TYPE_FLOAT
edt[i].value = 9999
edt[i].freeze = false
gg.setValues(edt)
end

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

On 1/21/2023 at 4:55 AM, XkPP said:

I found an important value of more than 5k results but this technique is slow to edit is there any other code that speeds up editing?

___

local edt = gg.getResults(gg.getResultCount())
for i,v in pairs(edt) do
edt[i].address = edt[i].address + 8
edt[i].flags = gg.TYPE_FLOAT
edt[i].value = 9999
edt[i].freeze = false
gg.setValues(edt)
end

 

for i,v in ipairs(edt) do 
edt[i].address = edt[i].address + 8 
end
edt = gg.getValues(edt) -- this will refresh the addresses values (don't use in loop to make the script faster)
gg.editAll('9999', gg.TYPE_FLOAT)

----------------------

--[[
In case you save the values in table and perform clear result u must use loadresult befor editall
Note: Don't use set Values inside loop it make the script slower use it outside it does the perfect job and don't use parameter u don't need such as freeze because it's false by default
]]

Link to comment
Share on other sites

On 1/23/2023 at 7:50 PM, XEKEX said:

for i,v in ipairs(edt) do 
edt[i].address = edt[i].address + 8 
end
edt = gg.getValues(edt) -- this will refresh the addresses values (don't use in loop to make the script faster)
gg.editAll('9999', gg.TYPE_FLOAT)

----------------------

--[[
In case you save the values in table and perform clear result u must use loadresult befor editall
Note: Don't use set Values inside loop it make the script slower use it outside it does the perfect job and don't use parameter u don't need such as freeze because it's false by default
]]

I understand, thanks

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.