Jump to content
  • 0

add a value, not change it


BloodMoonScript

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

Posted

[ @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

---

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

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.