Jump to content
  • 0

how to return the values


hoangninyb

Question

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!

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

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.