Is it able to run macro commands for loop?

gaspoe

New Member
Joined
Mar 9, 2019
Messages
11
Reaction score
0
Hello Daniel:

I would like to ask if it is possible to run macro commands for loop?
For example,I need mouse keeps moving and clicking randomly,so I can only type a lot of same macro sets like:

await Delay (1234);
SendMouseMove (Random(5,995),Random(5,590));
SendMouseClick(Random(5,995),Random(5,590), "left");
.....
.....the same macro sets about 30~50 times
.....
await Delay (1234);
SendMouseMove (Random(5,995),Random(5,590));
SendMouseClick(Random(5,995),Random(5,590), "left");

Is there any way to run looping macro instead of using lots of same macro sets?
Thank you.
 

MauroS5

Administrator
Staff member
Rule The Galaxy
Joined
May 10, 2018
Messages
199
Reaction score
15
Location
Spain
Website
9hitspoints.tk
Achievement
"while" is your way.
Example.

while (true){
await Delay (1234);
SendMouseMove (Random(5,995),Random(5,590));
SendMouseClick(Random(5,995),Random(5,590), "left");
}
 

gaspoe

New Member
Joined
Mar 9, 2019
Messages
11
Reaction score
0
Using the "while" command works great!
Thank you for sharing the tutorials.
 

daniel

Administrator
Staff member
VIP
Joined
Feb 23, 2018
Messages
268
Reaction score
36
Achievement
mauro's script is great, you can also using this if you want to limit number of the repeat loop.
Code:
var loopCount = Random(30, 50); //take a random number between 30-50
while (loopCount-- > 0){
	await Delay (Random(1, 5) * 0000);
	SendMouseMove (Random(5,995),Random(5,590));
	SendMouseClick(Random(5,995),Random(5,590), "left");
}
 

gaspoe

New Member
Joined
Mar 9, 2019
Messages
11
Reaction score
0
Thank you Daniel!
So actually I can use typical javascript commands in macro?
 

daniel

Administrator
Staff member
VIP
Joined
Feb 23, 2018
Messages
268
Reaction score
36
Achievement
gaspoe post_id=1241 time=1552657061 user_id=451 said:
Thank you Daniel!
So actually I can use typical javascript commands in macro?
Yes, it just javascript, and please have a look on the build-in 9hits functions listed on the panel :)
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu