Jump to content
  • 0

add a value, not change it


BloodMoonScript
 Share

Question

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

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • Moderators
42 minutes ago, BloodMoonScript said:

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

Maybe this? 

Any lua script command to just ADD to a value?? (#bhof9etu)

 

Link to comment
Share on other sites

  • 0

[ @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
Link to comment
Share on other sites

  • -1
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

Link to comment
Share on other sites

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
 Share

×
×
  • 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.