Jump to content
  • 0

lua | is possible, search - edit - save & search that & edit?


nio04

Question

title may seems weird.. what i mean is ~ 

 

i will search a value & edit it & save it  then after sometime i will call the save value again & edit that with different value

 

is this possible by lua script? plz help

 

oh btw - value address will be changed from game restart

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

11 hours ago, nio04 said:

title may seems weird.. what i mean is ~ 

 

i will search a value & edit it & save it  then after sometime i will call the save value again & edit that with different value

 

is this possible by lua script? plz help

 

oh btw - value address will be changed from game restart

I'm new to making Lua scripts myself but I think you might be able to do what you want by using:

revert = gg.getResults

I think that will call the value you've saved back and allow you to change it again.

Link to comment
Share on other sites

I blocked on your title didnt understand xD,

it is simple what your trying to do.

 

if not myValues then
  gg.clearResults()
  gg.searchNumber('', gg.TYPE_DWORD)
  gg.refineNumber('', gg.TYPE_DWORD)
  local myValues = gg.getResults(gg.getResultCount())
  gg.addListItems(r)
  gg.clearResults()
  
  else
    -- your value(s) is saved into the variable 'myValues'
    -- use this loop if there is 2 or more values to edit
    for k, v in pairs (myValues) do
        v.value = 'value to edit to'
    end
    gg.addListItems(myValues)


    -- if there is only one value then use this
    myValues[1].value = 'value to edit to'
    gg.addListItems(myValues)
end

 

To explain the concept is that you save your value inside a variable so you search value only once, dont copy paste, try to adapt it to your code

 

 

Link to comment
Share on other sites

4 hours ago, MAARS said:

local myValues = gg.getResults(gg.getResultCount())

This local variable needs to be created outside the "if" block for it to be visible in the "else" block where the variable is used: 

local myValues
-- ...
if not myValues then
  -- ...
  myValues = ... -- setting the variable created outside the block
  -- ...
else
  -- using the variable
end

 

4 hours ago, MAARS said:

-- your value(s) is saved into the variable 'myValues'
-- use this loop if there is 2 or more values to edit
for k, v in pairs (myValues) do
  v.value = 'value to edit to'
end
gg.addListItems(myValues)

-- if there is only one value then use this
myValues[1].value = 'value to edit to'
gg.addListItems(myValues)

 

"addListItems" function doesn't edit values unless they need to be frozen ("freeze" field being set to true), for editing values one needs to use "setValues" function.

Link to comment
Share on other sites

20 hours ago, nio04 said:

title may seems weird.. what i mean is ~ 

 

i will search a value & edit it & save it  then after sometime i will call the save value again & edit that with different value

 

is this possible by lua script? plz help

 

oh btw - value address will be changed from game restart

there are many ways to do that.

Its by script.

while true do
	if gg.isVisible() then
		local a = gg.choice({
			"Cheat A",
			"Edit data cheat A",
			"Exir"
		})
		gg.setVisible(false)
		if a then
			local a = {[a] = true}
			if a[1] then 
				gg.searchNumber("123456789", gg.TYPE_DWORD)
				if gg.getResultsCount() > 0 then 
					local a = gg.getResults(gg.getResultsCount()
					gg.saveVariable(a), gg.EXT_CACHE_DIR.."/cheat_a")
					gg.editAll("987654321", gg.TYPE_DWORD)
					gg.clearResults()
				end
			elseif a[2] then 
				local a = loadfile(gg.EXT_CACHE_DIR.."/cheat_a")
				if a then
					gg.loadResults(a())
					gg.setVisible(true)
					break
				end
			elseif a[3] then 
				break
			end
		end
	end
end

 

Link to comment
Share on other sites

2 hours ago, HEROGAMEOfficial said:

there are many ways to do that.

Its by script.


while true do
	if gg.isVisible() then
		local a = gg.choice({
			"Cheat A",
			"Edit data cheat A",
			"Exir"
		})
		gg.setVisible(false)
		if a then
			local a = {[a] = true}
			if a[1] then 
				gg.searchNumber("123456789", gg.TYPE_DWORD)
				if gg.getResultsCount() > 0 then 
					local a = gg.getResults(gg.getResultsCount()
					gg.saveVariable(a), gg.EXT_CACHE_DIR.."/cheat_a")
					gg.editAll("987654321", gg.TYPE_DWORD)
					gg.clearResults()
				end
			elseif a[2] then 
				local a = loadfile(gg.EXT_CACHE_DIR.."/cheat_a")
				if a then
					gg.loadResults(a())
					gg.setVisible(true)
					break
				end
			elseif a[3] then 
				break
			end
		end
	end
end

 

thanks a lot for ur effort & help! i will chek it 

[added 1 minute later]
9 hours ago, MAARS said:

I blocked on your title didnt understand xD,

it is simple what your trying to do.

 


if not myValues then
  gg.clearResults()
  gg.searchNumber('', gg.TYPE_DWORD)
  gg.refineNumber('', gg.TYPE_DWORD)
  local myValues = gg.getResults(gg.getResultCount())
  gg.addListItems(r)
  gg.clearResults()
  
  else
    -- your value(s) is saved into the variable 'myValues'
    -- use this loop if there is 2 or more values to edit
    for k, v in pairs (myValues) do
        v.value = 'value to edit to'
    end
    gg.addListItems(myValues)


    -- if there is only one value then use this
    myValues[1].value = 'value to edit to'
    gg.addListItems(myValues)
end

 

To explain the concept is that you save your value inside a variable so you search value only once, dont copy paste, try to adapt it to your code

 

 

thanks for ur help😊

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.