newstlastlist / GuruShots-auto-Voter

GuruShots free fills
35 stars 15 forks source link

Add a run script with a loop #5

Open sbursik opened 3 years ago

sbursik commented 3 years ago

Calling this to randomize the voting sessions in a loop. I just name the script runme.ps1 and call it from the c:\surushots directory I have my scripts in and run it from a powershell prompt.

2020-10-26 07_20_19-runme ps1 - C__gurushots_runme ps1 - SlickEdit

ccw0511 commented 3 years ago

how to use????

mshonak commented 3 years ago

I try this but got ( I made .bat file with this code ) :
C:\gurushots>while (1) 'while' is not recognized as an internal or external command, operable program or batch file.

C:\gurushots>{ '{' is not recognized as an internal or external command, operable program or batch file.

the code I use

while (1) { cd c:\gurushots node GuruShitsAutoLike.js $SLEEPTIME = powershell -Command Get-Random -Minimum 180 -Maximum 600 Write-output "Randomizing between voting sessions : sleeping for $SLEEPTIME" start-sleep -seconds $SLEEPTIME

} do I need to add\ put this code to GuruShitsAutoLike.js file ?

sbursik commented 3 years ago

how to use????

Call the script from a powershell prompt. It's not a batch script.

mshonak commented 3 years ago

ok thanks , I success to run it using powershell .

cbarroso76 commented 3 years ago

can you post script pls ?

cbarroso76 commented 3 years ago

cd c:\gurushots node GuruShitsAutoLike.js $SLEEPTIME = powershell -Command Get-Random -Minimum 180 -Maximum 600 Write-output "Randomizing between voting sessions : sleeping for $SLEEPTIME" start-sleep -seconds $SLEEPTIME

mshonak commented 3 years ago

Made file sleep.ps1 or any name you like with .ps1 at the end past this code : while (1) { cd c:\gurushots node GuruShitsAutoLike.js $SLEEPTIME = powershell -Command Get-Random -Minimum 180 -Maximum 600 Write-output "Randomizing between voting sessions : sleeping for $SLEEPTIME" start-sleep -seconds $SLEEPTIME }

when you want to start it just right click on the file and pick "run with PowerShell "

mshonak commented 3 years ago

I found also counter for the sleep time that I success to add to this ( I put this at the beginning of script) :

function Start-Sleep($seconds) { $doneDT = (Get-Date).AddSeconds($seconds) while($doneDT -gt (Get-Date)) { $secondsLeft = $doneDT.Subtract((Get-Date)).TotalSeconds $percent = ($seconds - $secondsLeft) / $seconds * 100 Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining $secondsLeft -PercentComplete $percent

}
Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining 0 -Completed

}

sbursik commented 3 years ago

Nice addition. Added it to mine.

sbursik commented 2 years ago

Try this script. Works great and gives some good output. I saved it as runme.ps1 and run it from a powershell.

`function Start-Sleep($seconds) { $doneDT = (Get-Date).AddSeconds($seconds) while($doneDT -gt (Get-Date)) { $secondsLeft = $doneDT.Subtract((Get-Date)).TotalSeconds $percent = ($seconds - $secondsLeft) / $seconds * 100 Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining $secondsLeft -PercentComplete $percent

} Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining 0 -Completed }

infinite loop for calling connect function

while(1)

{ <#Add your directory location#> cd c:\gurushots node GuruShitsAutoLike.js <#SLEEPTIME is in seconds. Here we are using 3 to 10 minues to randomize the vote time to appear less robotic#> $SLEEPTIME = powershell -Command Get-Random -Minimum 600 -Maximum 750 <# Comment out this line if you dont want to see the SLEEPTIME output in the command window #> Write-Output "Randomizing between voting sessions: Sleeping for $SLEEPTIME" start-sleep -seconds $SLEEPTIME

Stop-Process -Id $Pid -Force

} 2021-11-21 19_43_25-Administrator_ Admin_ C__gurushots - PowerShell 5 1 (45404)

`