I want to run 2 functions one after the other continuously i.e
function a();
function b();
function a();
However function b has to run a total of 20 times before a is called. My code looks like this:
var scaleTimes = 20;
banking();
Array.from({length: scaleTimes}, () => actions());
function actions () {
console.log('Starting');
robot.moveMouse(1246,465);
robot.moveMouse(1280,472);
robot.mouseClick("left", 1);
robot.moveMouse(1246,465);
robot.mouseClick("left",1);
console.log('Done...');
};
function banking () {
console.log('banking...');
robot.moveMouse(842,123);
sleep(600);
robot.mouseClick();
sleep(600);
robot.moveMouse(1024, 336);
sleep(600);
robot.mouseClick();
sleep(600);
robot.moveMouse(709,159);
sleep(600);
robot.mouseClick();
sleep(600);
robot.moveMouse(1064,49);
sleep(600);
robot.mouseClick();
sleep(4000);
console.log('done...');
};
How would i get this done by calling one single function at the start of my code?