Jump to content
  • 0

Just like we change the address "value" can we also change the address "name" while using the script?


Question

Posted

Just like we change the address "value" can we also change the address "name" while using the script?

gg.clearResults()
gg.searchNumber("8243116118139470284", 32)
gg.refineNumber("8243116118139470284", 32)
local t = gg.getResults(10)

for i,v in pairs(t) do
  
t[i].address = t[i].address - 0x30
t[i].flags = 1
t[i].value = 0
t[i].freeze = false

gg.setValues(t)
end
local t = gg.getResults(10)

for i,v in pairs(t) do
  
t[i].address = t[i].address + 0x10
t[i].flags = 16
t[i].value = 48
t[i].freeze = true

gg.setValues(t)
end
gg.clearResults()

20231231_101235.png

Recommended Posts

  • 0
Posted
3 hours ago, _yourram said:

is it useless to save values with different names? because when we use gg.loadResults(gg.getListItems(energy)) or gg.loadResults(gg.getListItems(health)) it gets all the values, well there is also an option for this we can use "refineNumber" but still it is useless for values which have same value.

So you don't need to use gg.addListItems()

Make three tables: control, health and energy. And process what you need in each table.

Main use of gg.addListItems() is to freeze values.

  • 0
Posted

[ @_yourram ]
---

Quote

is it useless to save values with different names? 

No, you can still obtain all the value from the saved list and filter the items based on 'name'. In your script, you didn't even add 'name' key into 'control' table, you just straight add them all:

control = gg.getResults(10)
gg.addListItems(control)

---

gg.loadResults(gg.getListItems(control))

This is wrong, gg.getListItems(): will take all items from savedlist, you can't specified it. What you can is:

gg.loadResults(control)

---

while true do
 if gg.isVisible() then
  gg.setVisible(false)
  Main()
 end
end
end

This part is wrong, you have multiple 'end' just for 'Main()' function. It will also contradict another 'while true do' you put earlier.
---
Here I fixed it:

function menus()
	choices = gg.choice({'Prepare Values','Search','Undo','Exit'})
	if choices == nil then
		os.exit()
	else
		if choices == 4 then
			os.exit()
		else
			prepares(choices)
		end
	end
end
	
function prepares(choices)
	if choices == 1 then
		-------------control--------------------
		gg.searchNumber('55;873', 16)
		gg.refineNumber('55', 16)
		control = gg.getResults(gg.getResultsCount())
		gg.clearResults()

		-------------health --------------------
		gg.searchNumber('47;67', 16)
		gg.refineNumber('47', 16)
		health = gg.getResults(gg.getResultsCount())
		gg.clearResults() 

		-------------energy --------------------
		gg.searchNumber('666;32;47', 16)
		gg.refineNumber('47', 16)
		energy = gg.getResults(gg.getResultsCount())
		gg.clearResults()

	elseif choices == 2 then
		-------------control--------------------
		gg.loadResults(control)
		gg.editAll('-55', gg.TYPE_FLOAT)
		gg.clearResults()
		
		-------------health --------------------
		gg.loadResults(health)
		gg.editAll('0', gg.TYPE_FLOAT)
		gg.clearResults()
		
		-------------energy --------------------
		gg.loadResults(energy)
		gg.editAll('999', gg.TYPE_FLOAT)
		gg.clearResults()
	
	elseif choices == 3 then
		-------------control--------------------
		gg.loadResults(control)
		gg.editAll('55', gg.TYPE_FLOAT)
		gg.clearResults()
		
		-------------health --------------------
		gg.loadResults(health)
		gg.editAll('47', gg.TYPE_FLOAT)
		gg.clearResults()
		
		-------------energy --------------------
		gg.loadResults(energy)
		gg.editAll('47', gg.TYPE_FLOAT)
		gg.clearResults()
	end
end


knxs = false
while true do
	if gg.isVisible(true) then
		knxs = true
	else
		knxs = false
	end
	if knxs == true then
		menus()
	else
		gg.setVisible(false)
	end
end

---

  • 0
Posted

[ @_yourram ]
---
The error means that there's no table named 'control', you need to run the 'prepare values' choice first. I can propose a better solution if you want.
---

Quote

thanks bro!

Your welcome
---

  • 0
Posted
18 minutes ago, kiynox said:

The error means that there's no table named 'control', you need to run the 'prepare values' choice first. I can propose a better solution if you want.

sure anyway I'm always curious to learn new things

----

  • 0
Posted

【 @kiynox 】ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ---

On 1/7/2024 at 11:41 AM, kiynox said:

This is wrong, gg.getListItems(): will take all items from savedlist, you can't specified it. What you can is:

gg.loadResults(control)

gg.loadResults(gg.getListItems()) is giving me results but gg.loadResults(troll) is not giving me results.

"can you tell the reason why this is happening?"

function BOSS1()

-- 1st Search Results ↓

gg.searchNumber("8243116118139470283", 32)

troll = gg.getResults(gg.getResultsCount())

gg.addListItems(troll)

-- 2nd Search Results ↓

gg.searchNumber("8243116118139479840", 32)

troll = gg.getResults(gg.getResultsCount())

gg.addListItems( troll)

-- 3rd Search Results ↓

gg.searchNumber("8143116118139470289", 32)

troll = gg.getResults(gg.getResultsCount())

gg.addListItems(troll)

-- 4th Search Results ↓

gg.searchNumber("9243116118139472811", 32)

troll = gg.getResults(gg.getResultsCount())

gg.addListItems(troll) 

gg.clearResults()

end

function BOSS2()

gg.loadResults(gg.getListItems())

-- Giving Results [ √ ]

gg.loadResults(troll)

-- Not Giving Results [ X ]

end 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.