Last active
May 3, 2020 13:13
-
-
Save npocmaka/dfa4a61584f648f306dbc7204131d565 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enableDelayedExpansion | |
if not exist mouse.bat ( | |
bitsadmin /transfer /_ /download "https://raw.githubusercontent.com/npocmaka/batch.scripts/master/hybrids/.net/c/mouse.bat" "%cd%\mouse.bat" | |
) | |
if not exist sendKeys.bat ( | |
bitsadmin /transfer /_ /download "https://raw.githubusercontent.com/npocmaka/batch.scripts/master/hybrids/jscript/sendKeys.bat" "%cd%\sendKeys.bat" | |
) | |
if not exist bc.html ( | |
call ::generateDummyHTML | |
) | |
call ::getScreenRes | |
::taskkill /im mshta* | |
::starts an empty screen program with a proper title that will be checked by the productivity watcher | |
::start "Barcelonachair.nl | Hét adres voor je Barcelona Chair!" /max mshta "jaascript:document.title = 'Barcelonachair.nl | Hét adres voor je Barcelona Chair!'" | |
::start "" /max bc.html | |
:: ^^ old aproach - I think I need to change sub-pages | |
set "link_1="https://www.barcelonachair.nl/"" | |
set "link_2="https://www.barcelonachair.nl/ottoman/"" | |
set "link_3="https://www.barcelonachair.nl/tweezitters/"" | |
set "link_4="https://www.barcelonachair.nl/account/login/"" | |
set "link_5="https://www.barcelonachair.nl/account/login/"" | |
set "link_6="https://www.barcelonachair.nl/accessoires/"" | |
set "link_7="https://www.barcelonachair.nl/eetkamerstoelen/"" | |
set "link_8="https://366561-barcelonachairnl.trengohelp.com/nl"" | |
set "link_9="https://366561-barcelonachairnl.trengohelp.com/nl/5284-advies"" | |
::you can add links ,but don't forget to increase the total number bellow: | |
set total_links=9 %= !!!!! =% | |
::start "" /max "https://www.barcelonachair.nl/" | |
:clickingLoop | |
taskkill /im chrome* | |
::generate random coordinates | |
SET /a x_rand=(%RANDOM%*300/32768) + (X/3) | |
SET /a y_rand=(%RANDOM%*300/32768) + (Y/3) | |
::random timeout | |
SET /a rand_sec=(%RANDOM%*15/32768)+1 | |
::random link from the available | |
set /a rand_link=(%RANDOM%*total_links/32768)+1 | |
start "" /max !link_%rand_link%! | |
::wait until the page is ready | |
typeperf "\System\Processor Queue Length" -si 5 -sc 1 >nul | |
echo %x_rand% %y_rand% | |
::move and click with the mouse | |
call mouse moveTo %y_rand%x%x_rand% | |
call mouse click | |
::just in case set focus again | |
call sendKeys "Barcelonachair.nl" "" | |
::wait between 0 and 15 seconds | |
typeperf "\System\Processor Queue Length" -si %rand_sec% -sc 1 >nul | |
::eternal clicking on the screen | |
goto clickingLoop | |
exit /b 0 | |
:getScreenRes | |
setlocal | |
for /f "tokens=4,5 delims=. " %%a in ('ver') do set "version=%%a%%b" | |
if version lss 62 ( | |
::set "wmic_query=wmic desktopmonitor get screenheight, screenwidth /format:value" | |
for /f "tokens=* delims=" %%@ in ('wmic desktopmonitor get screenwidth /format:value') do ( | |
for /f "tokens=2 delims==" %%# in ("%%@") do set "x=%%#" | |
) | |
for /f "tokens=* delims=" %%@ in ('wmic desktopmonitor get screenheight /format:value') do ( | |
for /f "tokens=2 delims==" %%# in ("%%@") do set "y=%%#" | |
) | |
) else ( | |
::wmic path Win32_VideoController get VideoModeDescription,CurrentVerticalResolution,CurrentHorizontalResolution /format:value | |
for /f "tokens=* delims=" %%@ in ('wmic path Win32_VideoController get CurrentHorizontalResolution /format:value') do ( | |
for /f "tokens=2 delims==" %%# in ("%%@") do set "x=%%#" | |
) | |
for /f "tokens=* delims=" %%@ in ('wmic path Win32_VideoController get CurrentVerticalResolution /format:value') do ( | |
for /f "tokens=2 delims==" %%# in ("%%@") do set "y=%%#" | |
) | |
) | |
::echo Resolution %x%x%y% | |
endlocal & ( | |
set X=%x% | |
set Y=%y% | |
) | |
exit /b 0 | |
:generateDummyHTML | |
echo ^<!DOCTYPE html^> >bc.html | |
echo ^<html^> >>bc.html | |
echo ^<head^> | |
echo ^<title^>Barcelonachair.nl | Hét adres voor je Barcelona Chair!^</title^> >>bc.html | |
echo ^</head^> >>bc.html | |
echo ^<body^> >>bc.html | |
echo ^</body^> >>bc.html | |
echo ^</html^> >>bc.html | |
exit /b 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment