BLUETOOTH HC-05 AT COMMANDS!!!

Hello all. How do you code a series of commands upon startup that are executed AT commands? I know how to manually enter the commands, but I want to code it so that when I open the serial monitor it automatically executes pre-coded AT commands in a series. Code is located below

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
Serial.write("AT");
}

void loop()
{

// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());

// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}

Nevermind. I found the answer to my own problem. In case anyone wants to know how to code AT commands programatically and have them run in a sequence or a string of commands, the key line of code is

btSerial.print("AT\r\n");
delay(1000);

the bluetoothserial line is from the bluetooth module to the arduino. print is just printing the command. AT is the basic command to make sure that there is communication. The delay is very important if you would like to code a sequence of commands. IF YOU DO NOT ADD THE DELAY YOU MAY HAVE ISSUES WITH THE CODE! (The delay doesn't have to be 1000 milliseconds, but there does need to be some type of delay.) If you do serial.write("AT") it will just put this as a text, and if you put serial.write(AT) it will try to treat the command as a variable. (Make sure to include the \r\n after every command!)