Skip to content

Latest commit

 

History

History
110 lines (83 loc) · 4.56 KB

File metadata and controls

110 lines (83 loc) · 4.56 KB

HoyoLab Check-In Helper

Contents

Pre-requisites

  • Google Account

Setting up

1. Setup in Google Apps Script

  1. Check-In URLs:

  2. Getting the Cookie:

    • Follow the HoyoLab Cookie Extraction Guide to obtain the cookie required for both daily check-ins and code redemption.
    • Use an incognito/private browsing window as recommended in the guide to ensure you copy the correct account's cookie.

2. Setup in Google Apps Script

  1. Create a New Project:

  2. Paste the Code:

    • Replace any existing code in the script editor with the provided Apps Script code. It should look like this:

      image

  3. Configuration:

    • Paste your cookie: In the config object, add the following (replace placeholders with your actual data):

      const config = {
        genshin: {
          data: [
            // "account_cookie_1",
            // "account_cookie_2",
            // ... more account cookies
          ]
        },
        honkai: {
          data: [
            // "account_cookie_1",
            // "account_cookie_2",
            // ... more account cookies
          ]
        },
        starrail: {
          data: [
            // "account_cookie_1",
            // "account_cookie_2",
            // ... more account cookies
          ]
        }
      };
    • Discord notifications (optional): Set DISCORD_WEBHOOK to your webhook URL to get a Discord message for every check-in.

      const DISCORD_WEBHOOK = "https://discord.com/api/webhooks/...";
    • Automatic code redemption (optional): Set enableCodeRedemption to true to redeem new codes after checking in. Not supported for Honkai Impact 3rd.

      const config = {
        enableCodeRedemption: true,  // redeem new codes automatically
        notifyOnRedeemFailure: false, // also report codes that failed to redeem
        // ...
      };

      When DISCORD_WEBHOOK is set, one summary message is sent per account listing the codes that were redeemed and the rewards they granted. Nothing is sent when there are no new codes. Turn on notifyOnRedeemFailure if you also want to hear about codes that failed - this includes a link to redeem them manually. Codes that fail for a temporary reason (expired cookie, redemption cooldown, network errors) are retried on the next run; expired, invalid, and already-used codes are not.

    • Save the Project: Click on the floppy disk icon to save your project.

      image

3. Run the Script

  1. Before Running It:

    • Make sure to select checkInAllGames or the script will not run.

      image

  2. Trigger the Function (Recommended):

    • In the Apps Script editor, click on the "Triggers" icon (clock symbol) in the left sidebar.
    • Click "+ Add Trigger" and configure:
      • Function to run: checkInAllGames
      • Event source: Time-driven
      • Type of time-based trigger: Day timer
      • Select time: Set your desired time for daily check-ins.
    • Save the trigger. This will automatically run your script every day at the specified time.
  3. Final Step:

    • Run the script once manually by clicking the play button in the Apps Script editor to authorize the script.

      image

Important Notes

  • Authorization: The first time you run the script, it will ask for authorization to access your Google account.
  • Logs: View the execution logs by clicking on the "Executions" icon (play button symbol) in the Apps Script sidebar.