|
Post by mahnster on Jun 9, 2016 17:40:26 GMT
There a certain spot in the safe area to start? I'm at sedathor safe area and still getting an error. Must be the resolution thing. It won't work on my phone but working flawless on an android emulator on pc. Thanks for this! Look forward to updates!
|
|
|
Post by tinotk on Jun 9, 2016 17:46:18 GMT
That is the code to show the option dialog. Have you ever got the Select task dialog opened? As it show in the first post? Glad it works on your emulator. Stay tuned , I'm almost finished with Daily quest and treasure hunt...
|
|
|
Post by tinotk on Jun 9, 2016 18:21:24 GMT
Yes, please make sure that you are in the safe area of the desired farming location, otherwise the script won't match the correct images. I forgot to mention that in the How to use. As of version 0.22b there should be 2 red boxes, one covers the map on top right corner and one covers the skills area. If these boxes is in correct area, the script should work. I purposely highlighted for debugging because every user has different devices and screen resolution. You could use exists() before using the click() to prevent errors Something like this: match = region:exists(pattern) if match ~= nil then click(match) else toast("No match found") end
As you can see, I also added a toast message to give some feedback to the user Sometimes you won't need to store the match into a variable, is those cases you could use a shorter version: if region:exists(pattern) ~= nil then click(region:getLastMatch()) end Doesn't exists() return the match object? I'm kinda confused when we comparing the result with ~= nil. So if a match is found, it returns the match (which is not nil) -> if condition will be true, in case it couldn't find a match then it will return none (which is false?? I believe). Isn't that boolean false is same as nil). So in both case, we don't have to compare the return object with ~= nil and the condition is still work as intended right? The value type nil is very interesting in lua, I didn't see it in other languages. Probably it's like null in Java
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Jun 9, 2016 19:50:28 GMT
You could use exists() before using the click() to prevent errors Something like this: match = region:exists(pattern) if match ~= nil then click(match) else toast("No match found") end
As you can see, I also added a toast message to give some feedback to the user Sometimes you won't need to store the match into a variable, is those cases you could use a shorter version: if region:exists(pattern) ~= nil then click(region:getLastMatch()) end Doesn't exists() return the match object? I'm kinda confused when we comparing the result with ~= nil. So if a match is found, it returns the match (which is not nil) -> if condition will be true, in case it couldn't find a match then it will return none (which is false?? I believe). Isn't that boolean false is same as nil). So in both case, we don't have to compare the return object with ~= nil and the condition is still work as intended right? The value type nil is very interesting in lua, I didn't see it in other languages. Probably it's like null in Java You're completely right about that. It's just my personal preference I wanted to show you an example of the exists() and the getLastMatch()
|
|
|
Post by mahnster on Jun 15, 2016 17:41:04 GMT
|
|
|
Post by tinotk on Jun 15, 2016 18:40:24 GMT
Download latest version and try again. The issue should be fixed as I've reduced the similarity of that picture to 0.5.
|
|
|
Post by mahnster on Jun 15, 2016 21:10:08 GMT
oh jeez..appreciate it! I hadnt checked first page nor seen any other posts thought you kinda gave up! Thanks dude!
|
|
|
Post by mahnster on Jun 15, 2016 21:39:19 GMT
|
|
|
Post by tinotk on Jun 15, 2016 22:12:17 GMT
What were you trying to do? It looks like you were doing treasure hunt? Have you any seen a toast msg saying "Treasure #.. you have.. times" ? Did you close all the dialog and go back to outside screen and on skill interface before starting the script? Which device or emulator are you using?
|
|
|
Post by AnkuLua on Jun 15, 2016 23:23:41 GMT
There a certain spot in the safe area to start? I'm at sedathor safe area and still getting an error. Please update AnkuLua to latest version.
|
|
|
Post by mahnster on Jun 16, 2016 18:07:51 GMT
What were you trying to do? It looks like you were doing treasure hunt? Have you any seen a toast msg saying "Treasure #.. you have.. times" ? Did you close all the dialog and go back to outside screen and on skill interface before starting the script? Which device or emulator are you using? I tried treasure hunt and team instance, both throw an error after trying for few mins. Yes i closed all dialog, and it opened the screen its at. I'm using memu emulator, and the goblin hunt works fine.
|
|
|
Post by tinotk on Jun 16, 2016 18:30:56 GMT
What were you trying to do? It looks like you were doing treasure hunt? Have you any seen a toast msg saying "Treasure #.. you have.. times" ? Did you close all the dialog and go back to outside screen and on skill interface before starting the script? Which device or emulator are you using? I tried treasure hunt and team instance, both throw an error after trying for few mins. Yes i closed all dialog, and it opened the screen its at. I'm using memu emulator, and the goblin hunt works fine. Let me download memu and take a look
|
|
|
Post by mahnster on Jun 16, 2016 18:40:26 GMT
I tried treasure hunt and team instance, both throw an error after trying for few mins. Yes i closed all dialog, and it opened the screen its at. I'm using memu emulator, and the goblin hunt works fine. Let me download memu and take a look I'll try newer version on my Samsung s6 again real quick.
|
|
|
Post by tinotk on Jun 16, 2016 18:45:13 GMT
Treasure hunt works fine in memu for me? Can you post a video showing how you use the script?
|
|
|
Post by mahnster on Jun 16, 2016 18:53:13 GMT
Treasure hunt works fine in memu for me? Can you post a video showing how you use the script? Wow works excellent on phone now. Let me try this .4 on memu, one sec.
|
|