Jump to content

Question

Posted

how do I change the value in the script via "add value"?

I no need  change directly like gg.editAll("1", gg.TYPE_DOUBLE)

I need if my value 15000, i write 2000, then this value = 17000

 

Ik how did it in gg, but idk how write to script

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

[ @BloodMoonScript ]
---

Quote

I need if my value 15000, i write 2000, then this value = 17000

Get the results -> Use gg.prompt() to ask user for the value to add -> Edit value from each result -> Apply the changes using gg.setValues()

gg.clearResults()
local search_input = gg.prompt(
	{'Enter a value to search: '}, {nil}, {'number'}
	)
if search_input[1] then
	gg.searchNumber(search_input[1], gg.TYPE_DWORD)
	local add_input = gg.prompt(
		{'Enter a value to add: '}, {nil}, {'number'}
		)
	if add_input[1] then
		local enumerate = gg.getResults(gg.getResultsCount())
		for k, v in ipairs(enumerate) do
			v.value = v.value + add_input[1]
		end
		gg.setValues(enumerate)
	end
end

---

Edited by kiynox
  • -1
Posted
11 hours ago, kiynox said:

[ @BloodMoonScript ]
---

Get the results -> Use gg.prompt() to ask user for the value to add -> Edit value from each result -> Apply the changes using gg.setValues()

gg.clearResults()
local search_input = gg.prompt(
	{'Enter a value to search: '}, {nil}, {'number'}
	)
if search_input[1] then
	gg.searchNumber(search_input[1], gg.TYPE_DWORD)
	local add_input = gg.prompt(
		{'Enter a value to add: '}, {nil}, {'number'}
		)
	if add_input[1] then
		local enumerate = gg.getResults(gg.getResultsCount())
		for k, v in ipairs(enumerate) do
			v.value = v.value + add_input[1]
		end
		gg.setValues(enumerate)
	end
end

---

Thx ofc, but i already did

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.