hoangninyb Posted July 1, 2021 Posted July 1, 2021 I have a question how to return the values that have been changed many times i tried with the code if revert ~= nil then gg.setValues(revert) end but it only returns the previous value, not the original value!
BadCase Posted July 1, 2021 Posted July 1, 2021 2 hours ago, hoangninyb said: I have a question how to return the values that have been changed many times i tried with the code if revert ~= nil then gg.setValues(revert) end but it only returns the previous value, not the original value! You have most likely changed the values in that table already, when you get the results you are editing do edit_table = gg.getResults(gg.getResultsCount()) revert_table = gg.getResults(gg.getResultsCount()) use edit_table when changing and setting values and revert_table when reverting to original values
hoangninyb Posted July 1, 2021 Author Posted July 1, 2021 2 hours ago, BadCase said: You have most likely changed the values in that table already, when you get the results you are editing do edit_table = gg.getResults(gg.getResultsCount()) revert_table = gg.getResults(gg.getResultsCount()) use edit_table when changing and setting values and revert_table when reverting to original values yes those values are i change i mean when it is not needed i want to return it to the original price eg at first the value was 10 i changed it to 20 then i again change to 21,23,22..... but after so many times i want to bring it back to 10, for example here there is one value but in reality i have so many different values so i can't use the method normal value fix method
HEROGAMEOfficial Posted July 1, 2021 Posted July 1, 2021 Save variable, if you want revert load file. Its simple example. gg.searchNumber("12345", 4) if gg.getResultsCount() > 0 then gg.saveVariable(gg.getResults(gg.getResultsCount()), gg.EXT_CACHE_DIR.."/original_value") gg.editAll("4321", 4) gg.editAll("112233", 4) gg.editAll("443322", 4) gg.setValues(dofile(gg.EXT_CACHE_DIR.."/original_value")) end
hoangninyb Posted July 3, 2021 Author Posted July 3, 2021 On 7/2/2021 at 6:42 AM, HEROGAMEOfficial said: Save variable, if you want revert load file. Its simple example. gg.searchNumber("12345", 4) if gg.getResultsCount() > 0 then gg.saveVariable(gg.getResults(gg.getResultsCount()), gg.EXT_CACHE_DIR.."/original_value") gg.editAll("4321", 4) gg.editAll("112233", 4) gg.editAll("443322", 4) gg.setValues(dofile(gg.EXT_CACHE_DIR.."/original_value")) end Thank bro, but it doesn't work, when there are multiple values
HEROGAMEOfficial Posted July 6, 2021 Posted July 6, 2021 On 7/3/2021 at 7:08 AM, hoangninyb said: multiple values Use next function. https://gameguardian.net/forum/topic/32820-how-to-clear-listitems-and-reset-values/?do=findComment&comment=119993
Question
hoangninyb
I have a question how to return the values that have been changed many times
i tried with the code
if revert ~= nil then gg.setValues(revert) end
but it only returns the previous value, not the original value!
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.