Jump to content
  • 0

How to loop without freeze the value? Like when value back to normal then trigger the loop


qeon
 Share

Question

First i looking for map value ("233;5;100::9) then refine (233) and change to 45000

Then value to trigger teleport to the area 45000

("1667;2;5731::9) Then refine (1667) and change to 2000

And loop when 45000 become 233 again

Sorry if i bother u guys😊

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

[ @qeon ]
---

gg.searchNumber("233;5;100::9", gg.TYPE_DWORD)
gg.refineNumber('233', gg.TYPE_DWORD)
results = gg.getResults()
gg.editAll('45000', gg.TYPE_DWORD)
gg.clearResults()

while(true)
	if gg.getValues({{address=results[1].address, flags=results[1].flags}}).value == '233' then
		gg.getValues(results)
		gg.editAll('45000', gg.TYPE_DWORD)
  		gg.clearResults()
	gg.sleep(5000) --in milisecond (5 second)
end

It uses infinite loop to check the value every 5 second, if the value is '233' then it will change it again to '45000'. Adjust accordingly, this is just a concept.
---

Link to comment
Share on other sites

  • 0
On 10/7/2024 at 5:00 PM, kiynox said:

[ @qeon ]
---

gg.searchNumber("233;5;100::9", gg.TYPE_DWORD)
gg.refineNumber('233', gg.TYPE_DWORD)
results = gg.getResults()
gg.editAll('45000', gg.TYPE_DWORD)
gg.clearResults()

while(true)
	if gg.getValues({{address=results[1].address, flags=results[1].flags}}).value == '233' then
		gg.getValues(results)
		gg.editAll('45000', gg.TYPE_DWORD)
  		gg.clearResults()
	gg.sleep(5000) --in milisecond (5 second)
end

It uses infinite loop to check the value every 5 second, if the value is '233' then it will change it again to '45000'. Adjust accordingly, this is just a concept.
---

How about trigger teleport for area after we change?

Link to comment
Share on other sites

  • 0
17 minutes ago, qeon said:

How about trigger teleport for area after we change?

this won't work.  once you get results,  it creates a table with that current value, it won't "change" when value changes in game..  try doing a timed loop that consistently gets values. 

Link to comment
Share on other sites

  • 0

Hi @APEXggV2. If the coordinate is constant, the above solution will work. In Minecraft, player coordinate will stay in place except if the player switch into a server, realm, or dimension. If the coordinate address keep changing, then just modify the code above:

function find_address()
	gg.searchNumber("233;5;100::9", gg.TYPE_DWORD)
	gg.refineNumber('233', gg.TYPE_DWORD)
	result = gg.getResults()
	gg.editAll('45000', gg.TYPE_DWORD)
	gg.clearResults()

	gg.searchNumber("1667;2;5731::9", gg.TYPE_DWORD)
	gg.refineNumber('1667', gg.TYPE_DWORD)
	results = gg.getResults()
	gg.editAll('2000', gg.TYPE_DWORD)
	gg.clearResults()

	return result, results
end

result, results = find_address()

while(true)
	if gg.getValues({{address=result[1].address, flags=result[1].flags}}).value == '233' then
		result, results = find_address()
	gg.sleep(5000) --in milisecond (5 second)
end

 

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.