|
Post by superbuff on Aug 20, 2016 17:42:24 GMT
Hello, My code has a simple waitClick("next.png") in the code and i'm getting the following error. I have confirmed that next.png exists in the image folder.
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:02:34 GMT
Hello, My code has a simple waitClick("next.png") in the code and i'm getting the following error. I have confirmed that next.png exists in the image folder. From Basic Object and Methods Introduction: I guess the pattern didn't get found within the default timelimit. You could try existsClick instead, this won't generate an exception
|
|
|
Post by superbuff on Aug 20, 2016 22:13:14 GMT
That's the thing, the time limit, according to the docs, is infinite. I suppose a bug exists or i mis interpret the sikuli docs. I'll give existsClick a try.
Basically a battle takes x variable time before it resolves and the next button shows. Will existsClick be suitable for that?
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:16:18 GMT
That's the thing, the time limit, according to the docs, is infinite. I suppose a bug exists or i mis interpret the sikuli docs. I'll give existsClick a try. Basically a battle takes x variable time before it resolves and the next button shows. Will existsClick be suitable for that? Depends... Don't you need AnkuLua to do things when in battle? Cause waiting using any of these functions will keep you from doing anything else...
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:18:11 GMT
Also, my post in another thread might just be what you're looking for (considering your questions about FSM and waitClick).
|
|
|
Post by superbuff on Aug 20, 2016 22:18:32 GMT
I'm writing a script for Brave Exvius which is as follows:
-Select level -Select friend -Select team -Turn on auto battle -Check when the "next" button shows up and click it <--- this is where it goes wrong - wait 5 seconds and click the result screen - click another next button - loop
So you see it's not that complicated. Really only need to wait for the next button to show up.
|
|
|
Post by superbuff on Aug 20, 2016 22:20:29 GMT
Also, my post in another thread might just be what you're looking for (considering your questions about FSM and waitClick). Haha yeah i found that earlier, that's where i got inspiration from on handling an out of energy screen. Cheers for that. Makes sense to simply scan for conditionals rather then pause/wait/sleep
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:27:30 GMT
I'm writing a script for Brave Exvius which is as follows: -Select level -Select friend -Select team -Turn on auto battle -Check when the "next" button shows up and click it <--- this is where it goes wrong - wait 5 seconds and click the result screen - click another next button - loop So you see it's not that complicated. Really only need to wait for the next button to show up. I got a similar situation. Here's what I did: On "turn on auto battle" I start looking for an image that's only present when in battle, once found I know the battle has started (done loading). Now I go into a cycle: Do some fighting moves (might be based on some patterns found using the exists() function), check if battleImage still exists (if not, we're done battling). So, I'm not looking for an image to appear to know if the battle has finished, but for an image to disappear. In the end, it doesn't really matter, the important thing is looping until the battle is done. Still, I'm stuck with a pretty dumb AI for fighting the battles But I won't be able to fix this unless I can somehow start doing things in an a-sync kind of way
|
|
|
Post by superbuff on Aug 20, 2016 22:31:59 GMT
I guess that explains the interest in FSM. It's still pretty dumb conditionals but with a better execution hierarchy. Why async though? Cant you use call backs? (callback hell i know but it's LUA)
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:37:46 GMT
I guess that explains the interest in FSM. It's still pretty dumb conditionals but with a better execution hierarchy. Why async though? Cant you use call backs? (callback hell i know but it's LUA) Na, the interest in FSM is mostly because I'm interested in any programming theory/architecture/philosophy. The more I learn, the better my programming skills will get, which in turn helps me to write code better/faster Callbacks would be a-sync enough for me though If you can tell me how I can get AnkuLua to look for patterns while doing clicks at the same time using callbacks, I would be forever grateful
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 20, 2016 22:40:01 GMT
Also, my post in another thread might just be what you're looking for (considering your questions about FSM and waitClick). Haha yeah i found that earlier, that's where i got inspiration from on handling an out of energy screen. Cheers for that. Makes sense to simply scan for conditionals rather then pause/wait/sleep Since you told someone to start the script at a certain screen in another thread, I assumed you hadn't found the post yet. Good to hear my posts are useful!
|
|
|
Post by superbuff on Aug 21, 2016 4:38:25 GMT
While I have your attention. I'm using someone else his script at the moment to farm. There is a point where i run out of energy and a pop up shows tell me so. The script will say it tries again in 5 minutes (1 energy is 5 minutes) but at one point during the night, i assume on the first dialog, it'll stop working.
What's a good way to simply wait 5 minutes before checking if i have enough energy? I assume i would close the dialog on the first time it shows. Wait/Sleep(300) Continue with loop
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Aug 21, 2016 8:16:42 GMT
While I have your attention. I'm using someone else his script at the moment to farm. There is a point where i run out of energy and a pop up shows tell me so. The script will say it tries again in 5 minutes (1 energy is 5 minutes) but at one point during the night, i assume on the first dialog, it'll stop working. What's a good way to simply wait 5 minutes before checking if i have enough energy? I assume i would close the dialog on the first time it shows. Wait/Sleep(300) Continue with loop I think I would do exactly what you suggested
|
|
|
Post by superbuff on Aug 21, 2016 8:46:56 GMT
well yeah but whats the difference between wait and sleep?
|
|
|
Post by AnkuLua on Aug 21, 2016 15:36:45 GMT
well yeah but whats the difference between wait and sleep? The same. Just for the compatibility with Sikuli.
|
|