Postition clic aléatoire

Vous voulez de l'aide ? Postez ici :)
Post Reply
Flexxi
Posts: 6
Joined: 06 Jan 2017, 23:25

Postition clic aléatoire

Post by Flexxi »

Salut :)
J'ai un petit soucis sur Actiona
Comment créer un clic aléatoire dans une zone spécifique.

J'ai crée 2 variables aléatoires x et y

var x = Math.floor(Math.random() * (820 - 530 +1)) + 530; Donc on est sur un intervalle aléatoire comprit entre 820 et 530 pour x

var y = Math.floor(Math.random() * (520 - 500 +1)) + 500; Pour y sur un intervalle aléatoire comprit entre entre 520 et 500

Si je veux faire un clic aléatoire, quelqu'un serait comment faire ?
J'ai juste à placer x:y en en clic sur le champs position ?

PS : Bonne année :)
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: Postition clic aléatoire

Post by francois »

Bonjour,

Avec du code :

Code: Select all

var x = Math.floor(Math.random() * (820 - 530 +1)) + 530; 
var y = Math.floor(Math.random() * (520 - 500 +1)) + 500;

var souris=new Mouse();
var point_alea = new Point(x, y);

souris.move(point_alea);
souris.click();
Flexxi
Posts: 6
Joined: 06 Jan 2017, 23:25

Re: Postition clic aléatoire

Post by Flexxi »

Merci :)
Post Reply