Jump to content
  • 0

Somebody please Help


anonymouxnash
 Share

Question

I want to write a script that will prompt the user to input a Dword they want to search and it will search and still print them to redefine when the value changes and still prompt them to input what they want the value to be.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Or with endless loop. 🙂

gg.clearResults()
gg.setVisible(false)
local a,b,c,d,e
gg.setRanges(gg.REGION_ANONYMOUS)

function inp(a,e)
::retr::
	out =gg.prompt(
	{e},
	{[1] = a},
	{[1] = 'number'}
	)
	if out == nil then goto retr end
	b = tonumber(out[1])
	return(b)
end

inp(0, 'Enter Your Number')
gg.searchNumber(b, gg.TYPE_DWORD, true, gg.SIGN_EQUAL, 0, -1, 0)
c = gg.getResults(1)

while true do
	d = gg.getValues({{address = c[1].address, flags = gg.TYPE_DWORD}})[1].value
	if d ~= b then
		inp(d, 'Refine Your Number')
		gg.setValues({{address = c[1].address, flags=gg.TYPE_DWORD, value = b}})
	end
end

 

Link to comment
Share on other sites

  • 0

[ @anonymouxnash ]

---

function changes(results_search)
 ::retries2::
 inputs = gg.prompt({'Set Values'}, {nil}, {'number'})
 if inputs == nil or inputs[1] == nil then
  goto retries2
 else
  for key, value in ipairs(results_search) do
   results_search[key].value = inputs[1]
  end
  alerts = gg.alert('Results:\n\n' .. tostring(results_search), 'continue', 'refine')
  if alerts ~= 1 then
   goto retries2
  else
   gg.setValues(results_search)
  end
 end 
end

function asks()
 ::retries::
 inputs = gg.prompt({'Search Number'}, {nil}, {'number'})
 if inputs == nil or inputs[1] == nil then
  goto retries
 else
  gg.searchNumber(inputs[1], gg.TYPE_DWORD)
  results_search = gg.getResults(gg.getResultsCount())
  alerts = gg.alert('Results:\n\n' .. tostring(results_search), 'continue', 'refine')
  if alerts ~= 1 then
   goto retries
  else
   changes(results_search)
  end 
 end
end

asks()

---

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.