Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- at.findText({
- options: options2,
- matchMethod: text => text.toLowerCase() === 'blsadfasdfsadf', // REQUIRED, How to do matching to determine found.
- duration: '2s', // OPTIONAL, how long time you want it to keep finding? Three formats are supported: 1. `duration: 10` means repeat finding 10 times, the value must be a number, can't be a string; 2. `duration: '60s'` means keep finding for 60 seconds, the value must be seconds + a character 's'; 3. `duration: '2020-05-30 12:00:00'` means keep finding till 2020-05-30 12:00:00. Default is `duration: 10` means repeat 10 times, the value must be a string.
- interval: 1000, // OPTIONAL, interval between loops in milliseconds, default is 1000 milliseconds.
- exitIfFound: true, // OPTIONAL, if exit findText if got a result successfully, default is true.
- eachFindingCallback: () => { // OPTIONAL, will call this function after each finding loop.
- console.log(`------Did a time of finding text at ${new Date().toLocaleString()}-------`)
- },
- foundCallback: result => { // OPTIONAL, will call this function while getting matched result, returns the rectangle coordinate matching the action you specified through `matchMethod`.
- console.log(`Got result of findText:\n${JSON.stringify(result, null, ' ')}`)
- //alert(`Got result of findText:\n${JSON.stringify(result)}`)
- clickAtX=result[0].bottomLeft.x;
- clickAtY=result[0].bottomLeft.y;
- console.log(`Should click at : ${clickAtX}, ${clickAtY} `)
- tap(clickAtX, clickAtY)
- },
- errorCallback: error => { // OPTIONAL, handle any error, will exit findText if got error, if no errorCallback provide, it will alert while getting error.
- alert(error)
- },
- completedCallback: () => { // OPTIONAL, callback when all finding completed
- console.log('The results is :' + result)
- },
- block: true, // OPTIONAL, you want to run findColors asynchronously or synchronously, block=true means it will run synchronously and block here till completed, default is false, doesn't block here.
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement