WhoKnowsWho Posted March 13, 2021 Posted March 13, 2021 I'm not sure but is this a bug?? I made the loop so that it search some values but I get 0 as a result, however when I search manually I do receive the results. mobizen_20210313_121010.mp4
0 CmP Posted March 13, 2021 Posted March 13, 2021 Just as @MonkeySAN mentioned, you don't need to guess whether anything was found and replaced. Instead it is enough to add logging to the code to find that out: loop = 0.1 for i = 0, 98 do print(string.format("Searching: %.15f", loop)) gg.searchNumber(loop, gg.TYPE_DOUBLE) local found = gg.getResultsCount() print(string.format("Found: %d", found)) gg.getResults(found) local edited = gg.editAll(500, gg.TYPE_DOUBLE) print(string.format("Edited: %d", edited)) gg.clearResults() loop = loop + 0.1 end This way you would see how many results were found and edited and it wouldn't be needed to guess anything. 3
0 MonkeySAN Posted March 14, 2021 Posted March 14, 2021 (edited) so i changed loop = loop + 0.1 to loop = string.format("%.15f", loop + 0.1) not sure if its the correct solution.. but got this results. Edited March 14, 2021 by MonkeySAN
0 WhoKnowsWho Posted March 14, 2021 Author Posted March 14, 2021 6 hours ago, Enyby said: In general, nothing is clear. The script does not have to show you at all that he found something there. This is not an animation to show anything. The fact that the values can be changed you have not shown. That they existed at the time of the search too. In general, it's not about anything at all. To assert something, you must prepare a reasoned justification and clear evidence that it happens this way, and not otherwise. This is not the case now. Until that happens, there will be no conversation. In the mean time a lot of answers here. Project_03-14_4K.mp4 [added 3 minutes later] 3 hours ago, CmP said: Just as @MonkeySAN mentioned, you don't need to guess whether anything was found and replaced. Instead it is enough to add logging to the code to find that out: loop = 0.1 for i = 0, 98 do print(string.format("Searching: %.15f", loop)) gg.searchNumber(loop, gg.TYPE_DOUBLE) local found = gg.getResultsCount() print(string.format("Found: %d", found)) gg.getResults(found) local edited = gg.editAll(500, gg.TYPE_DOUBLE) print(string.format("Edited: %d", edited)) gg.clearResults() loop = loop + 0.1 end This way you would see how many results were found and edited and it wouldn't be needed to guess anything. Yes, it saves a lot of time. Very handfull!
0 CmP Posted March 14, 2021 Posted March 14, 2021 Since "searchNumber" function expects a string as it's first argument, numeric value is converted to string before it is used to determine what to search for. Test code for your case from the video: local value = 0.1 for i = 1, 9 do print(value) value = value + 0.1 end Code execution result: Spoiler The problem should be obvious now. The solution is to not rely on automatic number to string conversion unless you are sure that it's result will be equal to what you expect. 1
0 WhoKnowsWho Posted March 14, 2021 Author Posted March 14, 2021 Yes, problem is very clear. Thank you all!
Question
WhoKnowsWho
I'm not sure but is this a bug??
I made the loop so that it search some values but I get 0 as a result, however when I search manually I do receive the results.
20 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now