i made this sometime ago...see if it work in your case.
local gg = gg
function set()
local d = gg.prompt({"Enter a value :"},{0})
if d == nil then gg.toast("Canceled") os.exit() else
gg.searchNumber(d[1], 4)
gg.toast("Done")
gg.alert("Now increase the value and search again")
while true do
if gg.isVisible() then
gg.setVisible(false)
break
end
gg.sleep(100)
end
local d = gg.prompt({"Enter a value :","Edit to :"},{0,0})
if d == nil then gg.toast("Canceled") gg.clearResults() else
gg.searchNumber(d[1], 4)
gg.toast("Done")
local t = gg.getResults(200)
for i,v in pairs(t) do
if v.flags == 4 then
v.value = -d[2]
end
end
gg.setValues(t)
gg.clearResults()
gg.toast("Done")
end
end
end
while true do
if gg.isVisible() then
gg.setVisible(false)
set()
end
end