Page 1 of 1

Postition clic aléatoire

Posted: 06 Jan 2017, 23:31
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 :)

Re: Postition clic aléatoire

Posted: 07 Jan 2017, 07:53
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();

Re: Postition clic aléatoire

Posted: 10 Jan 2017, 14:31
by Flexxi
Merci :)