Skip to content

Instantly share code, notes, and snippets.

@mrwm
Last active March 4, 2016 04:39
Show Gist options
  • Save mrwm/3f881a86ad8d4c07559e to your computer and use it in GitHub Desktop.
Save mrwm/3f881a86ad8d4c07559e to your computer and use it in GitHub Desktop.
Makes your computer say "balls" once in every 2 minutes in windows
'
'Credit for the author here: # Credit: https://www.reddit.com/r/AskReddit/comments/44tard/what_was_a_loophole_that_you_found_and_exploited/czt5wl8
'
Set WshShell = CreateObject("WScript.Shell")
Set WinFSO = CreateObject("Scripting.FileSystemObject")
Set oVoice = CreateObject("SAPI.SpVoice")
'Since you're probably playing with this script, create a batch file to easily kill it.
'WinFSO.CreateTextFile("stahp.plz.bat", True).Write "taskkill /im wscript.exe /f"
'Bonus points if you create a scheduled task. Here's a starting point:
'WshShell.Run "cmd /c SCHTASKS ........"
txt = "BALLS"
do
oVoice.Volume = 100
'This is equivalent to mashing the volume up key on your keyboard 50 times.
For i=1 To 50 : WshShell.SendKeys(ChrW(&hAF)) : Next
' WshShell.Run "Notepad" 'Opens new notepad isntance
'Bring Notepad to foreground. Equivelent to Alt-Tabbing a Fullscreen app.
' WshShell.AppActivate "Notepad" 'Perfect for the gamer in your family :)
oVoice.Rate = -4
For i=1 To Len(txt)
WScript.Sleep 50
letter = Mid(txt,i,1) 'Get 1 character starting at index i
WshShell.SendKeys(letter) 'Types the letter in whatever window is Active
oVoice.Speak(letter)
Next
WScript.Sleep 500
' WshShell.SendKeys(txt) 'Type out the entire word.
oVoice.Rate = -9 'Say it slow
oVoice.Speak(txt)
WScript.Sleep 160000 '160 seconds
loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment