//Script opens up the powershell and makes your computer speak out a message.
#include <Keyboard.h>
void setup() {
delay(7000);
KeypressCombo(KEY_LEFT_GUI, KEY_R);
delay(100);
Keyboard.println("powershell");
delay(3000);
Keyboard.println("Add-Type -AssemblyName System.speech");
delay(100);
Keyboard.println("$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer");
delay(100);
//Uncomment these lines to use a female voice
//Keyboard.println("$speak.SelectVoice('Microsoft Zira Desktop')");
//KeypressCombo(KEY_ENTER);
//delay(500);
Keyboard.println("$speak.Speak(\"Here's a joke. Why do Java programmers wear glasses? Because they can't C#.\")");
delay(100);
Keyboard.println("exit");
delay(100);
KeypressCombo(KEY_SPACE, MOD_ALT_LEFT);
delay(100);
KeypressCombo(KEY_N, null);
}
void loop() {}
void KeypressCombo(key1, key2)
{
Keyboard.press(key1);
delay(100);
if(key2 != NULL)
{
Keyboard.press(key2);
delay(200);
}
Keyboard.releaseAll();
delay(200);
}
void opencmd()
{
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
delay(300);
Keyboard.println("cmd");
delay(1000);
}