Mytz_321 Posted April 23, 2019 Share Posted April 23, 2019 anyone know how to make revert in the script i have 2 code but if i revert only last code revert -_ function gj() gg.searchNumber('526',gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) revert = gg.getResults() gg.editAll('65536',gg.TYPE_DWORD) t = gg.getResults() gg.addListItems(t) gg.toast('Anti pinball done') end function gh() gg.searchNumber('526',gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) revert = gg.getResults() gg.editAll('0',gg.TYPE_DWORD) t = gg.getResults() gg.addListItems(t) gg.toast('Anti pinball done') end fucntion rev() if revert ~= nil then gg.setValues(revert) end end Link to comment Share on other sites More sharing options...
Administrators Enyby Posted April 23, 2019 Administrators Share Posted April 23, 2019 You need add to revert table all new results. Not replace table - add new items in old table. But it is memory leak. If your script work long this can cause out of memory if you put in revert table huge amount of items. Link to comment Share on other sites More sharing options...
Mytz_321 Posted April 23, 2019 Author Share Posted April 23, 2019 9 minutes ago, Enyby said: You need add to revert table all new results. Not replace table - add new items in old table. But it is memory leak. If your script work long this can cause out of memory if you put in revert table huge amount of items. can you show me code? idk what you say hehehe Link to comment Share on other sites More sharing options...
maulz Posted April 23, 2019 Share Posted April 23, 2019 on = "[ ON ]" off = "[ OFF ]" status = off function main() local menu = gg.choice({status.." Anti pinball", "Exit"}, nil, "Demo script.") if menu == 1 then if status == off then status = on else status = off end process() elseif menu == 2 then os.exit() end end function process() if status == on then gg.searchNumber("526", gg.TYPE_DWORD) save = gg.getResults(100) -- Many values will be saved gg.editAll("65536", gg.TYPE_DWORD) gg.addListItems(save) gg.clearResults() gg.toast("Success active Anti pinball!", true) else -- Reverting values gg.getListItems(save) for i, v in ipairs(save) do save[i].value = "526" end gg.setValues(save) gg.removeListItems(save) gg.toast("Success deactive Anti pinball!", true) end end while true do if gg.isVisible() then gg.setVisible(false) main() end end You can use this if you want Link to comment Share on other sites More sharing options...
Mytz_321 Posted April 23, 2019 Author Share Posted April 23, 2019 1 minute ago, maulz said: on = "[ ON ]" off = "[ OFF ]" status = off function main() local menu = gg.choice({status.." Anti pinball", "Exit"}, nil, "Demo script.") if menu == 1 then if status == off then status = on else status = off end process() elseif menu == 2 then os.exit() end end function process() if status == on then gg.searchNumber("526", gg.TYPE_DWORD) save = gg.getResults(100) -- Many values will be saved gg.editAll("65536", gg.TYPE_DWORD) gg.addListItems(save) gg.clearResults() gg.toast("Success active Anti pinball!", true) else -- Reverting values gg.getListItems(save) for i, v in ipairs(save) do save[i].value = "526" end gg.setValues(save) gg.removeListItems(save) gg.toast("Success deactive Anti pinball!", true) end end while true do if gg.isVisible() then gg.setVisible(false) main() end end You can use this if you want if the value not 526? Link to comment Share on other sites More sharing options...
maulz Posted April 23, 2019 Share Posted April 23, 2019 1 hour ago, Mytz_321 said: if the value not 526? just change it 1 hour ago, Mytz_321 said: save[i].value = "526" Link to comment Share on other sites More sharing options...
Question
Mytz_321
anyone know how to make revert in the script i have 2 code but if i revert only last code revert -_
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.