View Single Post
Old 01-10-2025, 08:21 PM   #1
uruguru
All Star Starter
 
Join Date: May 2022
Posts: 1,203
Thumbs up Powershell script to shuffle teams in any schedule

I use Powershell scripts to modify a lot of the output pages in the almanac to my liking, and I recently wrote one to shuffle the teams in my hand-crafted schedules. This is needed because the "Shuffle Teams in Schedule" option doesn't actually shuffle teams in a schedule.. it just picks a new matching schedule from the schedules directory.

I've included a screenshot of how easy the script is to run. Put it in the same directory as your schedule, specify the input and output files, and it does the rest. It will not overwrite the output file if it already exists.

How it basically works:

It gets the number of teams in each division from the "<SCHEDULE" line of the input file. It then randomizes the order of teams within each division and writes that out to the output file. Literally takes about a second to run.

IMPORTANT: The "shuffleSchedule.txt" file must be renamed back to "shuffleSchedule.ps1" for it to be used as a powershell script. I had to rename it to a txt file to upload it here. Anyone can view the file and verify pretty quickly that it just reads the input file and writes to the output file.

If you need to learn how to run powershell scripts on your Windows PC, you will find plenty of info on how to do that via google.

To the OOTP devs: if you need something in-game to do this feature, feel free to copy the logic in the script or message me if you have any questions. OOTP could really use this feature in-game!
Attached Images
Image 
Attached Files
File Type: txt shuffleSchedule.txt (2.2 KB, 34 views)

Last edited by uruguru; 01-10-2025 at 10:08 PM.
uruguru is offline   Reply With Quote