Jump to content
  • 0

How to loop? to edit and repeat the automatic edit many times?


acl12

Question

Hello everyone, I would like to know how I could write a script that allows me
1º Find value
2º Edit and after 5 seconds or more let it edit but let it loop until you can stop the process.
Example

gg .searchNumber ("5; 523; 2", gg .TYPE_DWORD)

gg .refineNumber ("523", gg .TYPE_DWORD)

gg .editAll ("85", gg .TYPE_DWORD)

After editing the value it changes therefore I want it to be edited again with the same but without pressing anything, only automatic

    gg .sleep (1000)
     gg .toast ("3 seg")
     gg .sleep (1000)
     gg .toast ("2 seg")
     gg .sleep (1000)
     gg .toast ("1 seg")

gg .editAll ("85", gg .TYPE_DWORD)

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

On 18/12/2020 at 15:49, MAARS said:

puede congelar el valor.


 
  

 

Yes, that is a good option in my case, I do not want to freeze, I think that with a function I could create the same cycle several times, another example:

function bucle()

gg .searchNumber ("5; 523; 2", gg .TYPE_DWORD)

gg .refineNumber ("523", gg .TYPE_DWORD)

gg.getResults(gg.getResultsCount())

gg .editAll ("85", gg .TYPE_DWORD)

gg .sleep (1000)
     gg .toast ("3 seg")
     gg .sleep (1000)
     gg .toast ("2 seg")
     gg .sleep (1000)
     gg .toast ("1 seg")

bucle()

end

 

But here the problem is that when searching again it takes a long time then, here is my question, can I do that without searching again, just repeating what was edited several times?

Link to comment
Share on other sites

39 minutes ago, CmP said:

If you need to just keep editing values each 5 seconds indefinitely, the following code may suffice: 


while true do
  gg.editAll("85", gg.TYPE_DWORD)
  gg.sleep(5000)
end

 

I will try my friend, but would you help me more and how could I add within the same function bucle()

[added 1 minute later]
23 minutes ago, WhoKnowsWho said:

Make sure to search only in 1 region (if this value is in 1 region only) for speedup your search

In this case, it would search quickly, but in some low-resource devices, it takes time to search, and more when there are many search numbers, as in my case

Link to comment
Share on other sites

9 minutes ago, acl12 said:

I will try my friend, but would you help me more and how could I add within the same function bucle()

function bucle()
  gg.searchNumber("5; 523; 2", gg.TYPE_DWORD)
  gg.refineNumber("523", gg.TYPE_DWORD)
  gg.getResults(gg.getResultsCount())
  while true do
    gg.editAll("85", gg.TYPE_DWORD)
    gg.sleep(5000)
  end
end

 

Link to comment
Share on other sites

1 hour ago, acl12 said:

Yes, that is a good option in my case, I do not want to freeze, I think that with a function I could create the same cycle several times, another example:

function bucle()

gg .searchNumber ("5; 523; 2", gg .TYPE_DWORD)

gg .refineNumber ("523", gg .TYPE_DWORD)

gg.getResults(gg.getResultsCount())

gg .editAll ("85", gg .TYPE_DWORD)

gg .sleep (1000)
     gg .toast ("3 seg")
     gg .sleep (1000)
     gg .toast ("2 seg")
     gg .sleep (1000)
     gg .toast ("1 seg")

bucle()

end

 

But here the problem is that when searching again it takes a long time then, here is my question, can I do that without searching again, just repeating what was edited several times?

create a table a save the values

Link to comment
Share on other sites

On 1/1/2021 at 5:13 PM, CmP said:

function bucle()
  gg.searchNumber("5; 523; 2", gg.TYPE_DWORD)
  gg.refineNumber("523", gg.TYPE_DWORD)
  gg.getResults(gg.getResultsCount())
  while true do
    gg.editAll("85", gg.TYPE_DWORD)
    gg.sleep(5000)
  end
end

 

ty It helped me

Link to comment
Share on other sites

you can just freeze the value.

gg.refineNumber("523", gg.TYPE_DWORD)
r = gg.getResults(10) -- or greater than 10

r.flags = gg.TYPE_DWORD
r.value = "85" --The value you want to edit to
r.freezeType = gg.FREEZE_NORMAL
gg.addListItems(r)
gg.setValues(r)
gg.clearResults()

 

Link to comment
Share on other sites

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.