Advertisement
spastek

F13 No Idle

Apr 4th, 2022
1,270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $dummyshell = New-Object -com "Wscript.shell" #new shell
  2. $rn = 0; #rn for repeated number of time.
  3. while(1) #while(true)
  4. {
  5. $dummyshell.sendkeys("{F13}") #sends F13 to Shell window
  6. $rn++ #increments Repeat number by 1
  7. Function Sleep-Progress($seconds) {
  8.     $s = 0; #Used to subtract from $seconds to see how many seconds are left and to figure out rough progress
  9.     Do {
  10.         $p = [math]::Round(100 - (($seconds - $s) / $seconds * 100)); #make progress roughly out 100%
  11.         Write-Progress -Activity "Until next scan..." -Status "$p% Complete:" -SecondsRemaining ($seconds - $s) -PercentComplete $p; #the progress bar
  12.         $sr = $seconds - $s #Second Remaining until repeat
  13.         $Title = "$sr - $rn" #Change the title to show Seconds remaining and number of repeats
  14.         $host.UI.RawUI.WindowTitle = $Title
  15.         [System.Threading.Thread]::Sleep(1000) #sleep for 1 second
  16.         $s++; #add one $s
  17.     }
  18.     While($s -lt $seconds); #do the above while $s is less than $seconds
  19.  
  20. }
  21. Sleep-Progress 30 #Change this number to how many seconds you want before it repeats
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement