Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlers would only be activated after one minutes run. #21

Open
truebit opened this issue May 25, 2015 · 2 comments
Open

Handlers would only be activated after one minutes run. #21

truebit opened this issue May 25, 2015 · 2 comments

Comments

@truebit
Copy link

truebit commented May 25, 2015

I set monkey to run in 2 hours (a.k.a 120 minuete), and I also created a ButtonHandler.
I add the logs in buttonhandler, I found that the ButtonHandler was never triggered until one minutes running.

See the first and last line in the log. the last line is the log I added in buttonhandler. that's its first appearance

2015-05-25 09:31:57 +0000 Debug: 119.99991666666666 minutes left to run.
2015-05-25 09:31:57 +0000 Debug: target.tapWithOptions({x:"230", y:"200"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:57 +0000 Debug: target.tapWithOptions({x:"187", y:"381"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"55", y:"159"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"113", y:"186"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"179", y:"136"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"151", y:"527"}, {touchCount:"2", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"3", y:"1"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:58 +0000 Debug: target.tapWithOptions({x:"156", y:"217"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:59 +0000 Debug: target.tapWithOptions({x:"58", y:"75"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:59 +0000 Debug: target.tapWithOptions({x:"67", y:"456"}, {touchCount:"1", duration:"0", tapCount:"1"})
2015-05-25 09:31:59 +0000 Debug: ButtonHandler 返回 find result is false
@truebit
Copy link
Author

truebit commented May 25, 2015

I added some verbose output, found that the length of monkey.config.conditionHandlers is 0 when RELEASE_THE_MONKEY() method start running

my code is like:

#import "ui-auto-monkey/UIAutoMonkey.js"
#import "ui-auto-monkey/buttonHandler.js"
monkey = new UIAutoMonkey()
monkey.config.minutesToRun = 60 * 2; 
monkey.config.checkTimeEvery = 60; 
monkey.config.numberOfEvents = false; 

var handlers = [ ];
handlers.push(new ButtonHandler("Back", 30, false)); 
monkey.config.conditionHandlers = handlers;

// Release the monkey!
monkey.RELEASE_THE_MONKEY();

@BruceBGordon
Copy link

Did you comment out the "RELEASE_THE_MONKEY() code in the orginal UIAutoMonkey.js file"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants