Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Рандом число
- Random rnd = new Random();
- Tab tab1 = instance.ActiveTab;
- // Ожидание загрузки страницы
- if (tab1.IsBusy) tab1.WaitDownloading();
- // Находим ссылку
- var post = tab1.FindElementByAttribute("a","href",project.Variables["link"].Value,"text", 0);
- //Определяем, на каком расстоянии от края страницы находится кнопка
- int topInBrowser = int.Parse(post.GetAttribute("topInBrowser"));
- int leftInBrowser = int.Parse(post.GetAttribute("leftInBrowser"));
- // Доп эмуляция движения мыши
- Random mouseMoveRnd = new Random();
- if (mouseMoveRnd.Next(0,2)==1){
- tab1.FullEmulationMouseSetOptions(rnd.Next(3,7),rnd.Next(3,10),rnd.Next(3,10));
- tab1.FullEmulationMouseMove(rnd.Next(leftInBrowser-50,leftInBrowser+50), rnd.Next(topInBrowser-50,topInBrowser+50));
- }
- // Эмуляция мыши для перехода по ссылке
- tab1.FullEmulationMouseSetOptions(rnd.Next(3,7),rnd.Next(3,10),rnd.Next(3,10));
- // Ховер на элемент
- int x = leftInBrowser + rnd.Next(5,15);
- int y = topInBrowser + rnd.Next(5,15);
- tab1.FullEmulationMouseMove(x, y);
- Thread.Sleep(rnd.Next(200,600));
- // Клик на элемент
- tab1.FullEmulationMouseClick("left", "click");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement