This is a detailed breakdown of the "Popmundo Itinerary Booker (Improved)" Tampermonkey userscript.
📜 Overview
The Popmundo Itinerary Booker is a powerful automation tool designed for the online game Popmundo. Its primary function is to automate the process of booking a series of shows (a tour) for an artist. The script injects a user-friendly control panel onto the "Book Show" page, allowing you to define a comprehensive set of rules and preferences for your tour. Once started, it systematically works through a predefined travel itinerary, finding and booking the best available clubs that match your criteria, saving you hours of manual clicking.
⚙️ Core Features & Functionality
The script's logic is broken down into several key areas:
1. Control Panel UI
When you navigate to an artist's "Book Show" page, the script injects a configuration panel. This panel is the command center for the script and allows you to customize every aspect of your tour.
- Artist ID: The specific ID of the artist you want to book shows for.
- Tour Dates: Set a Start Date and a Final Date to define the time frame for the tour.
- Itinerary: Choose a Start City from a list derived from the script's hardcoded tour route.
- Show Frequency:
- Shows Per City: The number of concerts to book in each city before moving to the next.
- Shows Per Date: The maximum number of shows to book on any single calendar day across all cities.
- Club Filtering:
- Club Price Range: Set a minimum and maximum price for the clubs you want to book, ensuring you target venues that fit your artist's popularity.
- Show Times: Select one or more specific times of day for your shows (e.g., 20:00, 22:00).
- Require 5 Stars: A checkbox to filter for only the highest-quality, 5-star venues.
- Booking Logic:
- Block Two Shows...: An option to prevent booking two shows in the same city on the same day, which is generally not allowed by the game.
2. Tour Generation
When you click "Start Booker," the script performs a one-time calculation to generate the entire tour plan.
- It begins from your selected Start City and Start Date.
- It references a hardcoded
TOUR_ITINERARY
array, which contains a long list of cities and the travel time in hours between them.
- It calculates the arrival time in the first city.
- It then finds the next available show slot based on your selected Show Times and Shows Per Date limits.
- After booking the specified Shows Per City, it calculates the travel time to the next city in the itinerary and repeats the process.
- This continues until it reaches the specified Final Date. The entire generated tour is then saved to your browser's
localStorage
.
3. Automated Booking Cycle
Once the tour is generated, the script begins its main execution loop. For each show in the generated plan:
- Navigation: It ensures you are on the correct "Book Show" page for your artist. If not, it redirects you.
- City Selection: It selects the correct city for the current show from the dropdown menu. This triggers a page reload.
- Date & Time Selection: After the page reloads with the correct city, it inputs the show's date and time.
- Find Clubs: It clicks the "Find Clubs" button to load the list of available venues.
- Club Analysis: It scans the resulting table of clubs and filters them based on your settings (5-star requirement, price range). It also checks a stored list of recently booked clubs to avoid booking the same venue within the same game week.
- Book Best Club: From the filtered list of valid clubs, it identifies the one with the highest price and selects it.
- Confirmation: It clicks the "Book Show" button and then automatically clicks the final "Yes" or "OK" in the confirmation dialog.
- Advance: After a successful booking (or if no valid clubs were found), it increments its internal counter and moves on to the next show in the tour, starting the cycle over again.
4. State Management
The script cleverly uses browser storage to keep track of its progress, making it resilient to accidental page reloads.
sessionStorage
is used to store the current status (IDLE or RUNNING) and your chosen settings.
localStorage
is used for more persistent data, including the fully generated tour, the index of the current show being processed, and a list of booked clubs to avoid duplicates.
📝 How to Use
- Install a Userscript Manager: You need a browser extension like Tampermonkey (for Chrome, Firefox, Edge) or a similar manager.
- Install the Script: Create a new script in your userscript manager and paste the entire code into it.
- Navigate to Popmundo: Go to the "Book Show" page for the artist you wish to manage. The path typically looks like:
https://[XXX].popmundo.com/World/Popmundo.aspx/Artist/BookShow/[ArtistID]
.
- Configure Your Tour: Fill out the fields in the "Itinerary Booker" panel that appears on the page. Select your desired start date, city, show times, and club preferences.
- Start the Process: Click the "Start Booker" button. The form will hide, and the status will update as it begins working.
- Let it Run: Keep the browser tab open and active. The script will now navigate, click, and book shows on its own. You can monitor its progress via the status text and the browser's developer console.
- Stop the Process: To end the automation at any time, simply click the "Stop Booker" button. This will halt the script and clear all its stored data. The script will also stop automatically upon completing the tour.