Luvi Silverberg
November 11, 2022

How to Play a Random Clip From Streamer When Raided

Introduction

You don’t want to watch all the same streamers all the time, but you want to show support for your favorite ones. Well now you can play a random clip from any streamer!

Create a file called played.txt

To get this working, we need to create a text file with the streamer's name in it. Open notepad and save your new file as played.txt. When you've done that, add the names of all the streamers you want to play music for when raided by them until you're left with something like this:

The important thing here is making sure that each username is spelled correctly; otherwise it won't work properly!

Add a streamer to the text file example eaglespirit123

Once you have added the streamer name to your text file, it should look like this:

eaglespirit123

  • The first number is the raid group ID

  • The second number is the raid group multiplier

Add the command !playraid in your chat, it will choose a random line from the text file and play that

if (streamer.isPlayingClip) {

Console.WriteLine(streamer.channelName + " is playing a clip.");

} else if (streamer.isTalking) {

Console.WriteLine(streamer.channelName + " is talking.");

} else if (streamer == null) {

Console.WriteLine("Could not locate streamer information.");

}

String[] lines = new String[5]; int index = 0; //open text file and read in the lines of text into an array of strings StreamReader reader = new StreamReader(@"C:\Users\YourUsername\Desktop\yourfilename"); FileInfo fi = new FileInfo("yourfilename"); string line; while ((line = reader.ReadLine()) != null) { // while there's still data to read from the file, do this:

lines[index] = line; //assign each line in turn to an element in our array }

Takeaway:

You can use this script to play a random clip from any streamer on Twitch.tv when you're raided by them.

You can add other streamers in the text file and their clips will play instead of yours when they raid you.

You can also add commands to the file, such as "!raided" or "!freetoast". When someone types these into chat, it will trigger your clip as well as show a message that says "You were raided!"

Conclusion

Hopefully, we’ve helped you get the most out of your Raids by using these tips! If you have any questions or comments about our method, please feel free to reach out to us. If this guide helped in any way, please share with others who might benefit from it as well.