Note
Announcement: This project is now also available as a Discord Bot at https://project-focalor.nattapat2871.me
Just join our Discord server and the bot will guide you step by step — no need to run any scripts or set up Google Apps Script.
It supports multiple accounts & multiple games, and even has an automatic redeem-code system.
Currently the bot works in Thai language (multi-language support will be added later).
Available starting today: 13/09/2025
English ภาษาไทย
This Javascript is an automatic script for Google Apps Script. It handles your daily HoYoLab check-ins automatically and sends you status updates through a Discord Webhook. It's free, easy to use, and super safe.
- Cool Notification Window - The Discord notification embeds for check-ins look great.
- Safe - You can use and adapt this script yourself without worrying about your data leaking.
- Free - You can use this script for free on Google App Script or use the Javascript version.
- Easy to Use - The script works without needing to open any websites, and it automatically notifies you via Discord Webhooks.
- Easy Setup - There's a specific section in the script you can customize, like which games to check in, UIDs, language, Discord notifications, or even customizing the webhook name and avatar.
- Check-ins - Although it supports Multiple account, And if all your games use the same HoYoLab account, it can check in for all of them:
Genshin Impact, Honkai Star Rail, Zenless Zone Zero, Honkai Impact 3, Tears of Themis.It works for all servers too:Asia, Europe, America, TW HK MO server.
- Copy the script code for rimuru-gives-you-primogems.gs which is used on Google App Script.
- Go to Google App Script and create a new project. Name it whatever you like. (Note: The link in the original text pointed to GitHub, but the context implies Google App Script).
- Edit the section labeled
Configuration Sectionhis includes your Token, game settings, UIDs, and Discord notification settings. , See the Configuration guide below for help. - Select
mainfunction from the dropdown menu at the top and clickrun. You'll need to grant the necessary permissions. - Set up a
Triggerso the script runs automatically at a set time. Go toTrigger(the clock icon on the left sidebar), clickAdd Triggerand set it up like this: Choose function to run:mainChoose deployment:HeadSelect event sourceTime-drivenSelect type of time based trigger:Day timerSelect time of day2am - 3am" (or whenever you prefer)Set error notification settings:Notify me dailyThen clickSave
const profiles = [
{ // --- Configuration Section ---
// Main Account
accountName: "Main", // <--- Enter AccountName
myDiscordID: "", // <--- Enter ID Discord of account owner.
token: "ltoken_v2=xxxxxx; ltuid_v2=xxxxxx;", // <--- PUT YOUR TOKEN
// --- Setting the game to enable (true = enable, false = disable) ---
genshin: true,
honkai_star_rail: true,
zzz: true,
honkai_3: true,
tears_of_themis: true,
// --- Enter your UID ---
customUids: {
Genshin: "",
Star_Rail: "",
ZZZ: "",
Honkai_3: "",
Tears_of_Themis: ""
},
// --- Support 15 languages ---
// English: en-us
// 简体中文 (Simplified Chinese): zh-cn
// 繁體中文 (Traditional Chinese): zh-tw
// 日本語 (Japanese): ja-jp
// 한국어 (Korean): ko-kr
// Bahasa Indonesia (Indonesian): id-id
// Deutsch (German): de-de
// Español (Spanish): es-es
// Français (French): fr-fr
// Italiano (Italian): it-it
// Português (Portuguese): pt-pt
// Русский язык (Russian language): ru-ru
// ภาษาไทย (Thai language): th-th
// Türkçe (Turkish): tr-tr
// Tiếng Việt (Vietnamese): vi-vn
lang: 'en-us' // <--- Enter the desired language.
},
{
// Account 2 : If you want to log in to Multiple_accounts
accountName: "", // <--- Enter AccountName
myDiscordID: "", // <--- Enter ID Discord of account owner.
token: "ltoken_v2=xxxxxx; ltuid_v2=xxxxxx;", // <--- PUT YOUR TOKEN
// --- Setting the game to enable (true = enable, false = disable) ---
genshin: true,
honkai_star_rail: true,
zzz: true,
honkai_3: true,
tears_of_themis: true,
// --- Enter Your UID ---
customUids: {
Genshin: "",
Star_Rail: "",
ZZZ: "",
Honkai_3: "",
Tears_of_Themis: ""
},
lang: 'en-us' // <--- Enter the desired language.
},
/*
{
// Account 3 , 4 , 5 : If you have multiple accounts, you can copy the format from above and add them yourself.
accountName: "", // <--- Enter AccountName
myDiscordID: "", // <--- Enter ID Discord of account owner. etc. */
];
/** Multiple account login **/
const Multiple_accounts = false; // <--- true = (on) multiple account login, false = (off) Main account login only
/** Discord Notification **/
const discord_notify = true; // Set to true to enable Discord notifications.
const discordWebhooks = [
"https://canary.discord.com/api/webhooks/", // <--- Enter Main Webhook URL
/* You can add a URL to send notifications to any message box. */
// "https://canary.discord.com/api/webhooks/", // <--- Enter Webhook URL 2
// "https://canary.discord.com/api/webhooks/", // <--- Enter Webhook URL 3
];
const webhooks_username = "ʀɪᴍᴜʀᴜ ɢɪᴠᴇꜱ ʏᴏᴜ ᴛʜᴇ ᴘʀɪᴍᴏɢᴇᴍ" // <--- Enter Username Webhooks
const webhooks_avatar_url = "https://cdn.discordapp.com/attachments/1276433865375879199/1277718573439127572/image.png?ex=66ce2fa6&is=66ccde26&hm=0e32ea05e2b673c64ae1bfc310bd5e045875a6d5798c768c18f877929922540a&" // <--- Enter Avatar URL link
/** Notification message in Embeds*/
const logedin_text = "has logged in!"
const totalclaim_text_1 = "Total Claimed"
const totalclaim_text_2 = "days this month"
// ---- This is all that needs to be fixed. ----accountNameName the account. Basically, you should name it as:MainmydiscordIDPut your Discord User ID here. This helps identify the HoYoLab account owner and allows the bot to ping you in notifications.tokenYou need to paste your HoYoLab token here so the script can log in for you.token: "ltoken_v2=xxPasteValueHerexx; ltuid_v2=xxPasteValueHerexx;",See more info hereChoose which games to auto check-inSet which games you want to automatically check in. You can turn only some on. For example, if you only want Genshin, change it togenshin: true, honkai_star_rail: false, zzz: false, honkai_3: false, Tears of Themis: false,CustomUidEnter your game UID for each game here. It's optional.langThis sets the language for responses. For Japanese, change it tolang: 'ja-jp'Multiple_accountsEnable multiple accounts if you needtrueYou need setup multiple accounts asAccount 2If you don't use it, you can just turn it off.falsediscord_notifyturns onDiscord webhook notifications. Iffalse, the results will just show up in theConsoleloginstead.discordWebhookThe script needs this URL to send notifications. Go to a Discord server you own or manage:Create a new channel > Edit Channel > Integrations > Webhooks > Create Webhook > Copy Webhook URLand paste it here.webhooks_usernameและwebhooks_avatar_urlเSet the name and profile picture the webhook will use when sending notifications.
That's all you need to edit yourself. Don't mess with the rest of the script code below that, as it's needed for the script to run correctly.
It's a unique piece of data used to verify your identity (Authentication) when you want to access HoYoLab info or services using a program or script, instead of just Browse the website normally. Usually, these Token are stored in your web browser's Cookies after you log into the HoYoLab website. HoYoLab You can find yourา ltuid and ltoken values using:
Chome Desktop Browser ( Finding the values on Desktop )
-
Go to Web - You can grab the token from your browser by going to the official HoYoLab website.
-
Login - Log into the website properly.
-
Developer tools - Open Developer Tools. Go to the
3-dot iconin the top-right corner of browser's app. >More tools>Developer toolsor just pressF12 -
Cookies - Go to the
Applicationtab, then look understorage>cookies>https://hoyolab.com/homeTypeltinto thefilterbox. -
Token - You should see
ltoken_v2( yellow box in image ) andltuid_2( red box in image ) under theNAMEcolumn, like in the picture below. -
Config - Copy the
Valueforltoken_v2(any one line) andltuid_v2(any one line) and paste them into the Config section like this:token: "ltoken_v2=xxxxxx; ltuid_v2=xxxxxx;",
Mobile Kiwi Browser Extension ( Finding the values on Mobile )
iOS - There's currently no way to view the
tokenon mobile because iOS has limitations and doesn't support apps withdeveloper tools
Since Chome Moblie doesn't have Developer tools , you need to use Kiwi browser and the Cookie Editor Extension instead **
- Kiwi browser - It's a web browser for Android based on Chromium (same as Google Chrome). Its main feature is that it
supports most Extensionsfrom the Chrome Web Store directly on your Android phone.
-
Install Kiwi browser - You can install Kiwi browser from the play Store
-
Extension - Once downloaded, open the app and go to
More (3 dots)in the top-right corner >ExtensionSearch for and install the Cookie-Editor extension And ClickAdd to kiwi>install -
Go To Web - After installing the extension, go to the official HoYoLab website and log in completely.
-
Token - Click the
More (3 dots)icon again, And go toExtension>Cookie-EditorYou'll see all thecookiesfor the website. Scroll down to findltoken_v2andltuid_v2 -
Config - Copy the
Valueforltoken_v2andltuid_v2and paste them into the Config section:token: "ltoken_v2=xxxxxx; ltuid_v2=xxxxxx;",
Important
Your HoYoLAB Token is like a password for your HoYoverse account. If someone else gets this Token, they can access your HoYoLAB account without needing your password, check >your private info like check-in history, game profiles, or your activities on HoYoLAB, or maybe even worse. So, please keep your Token safe! Don't share it publicly with >others. If you think your Token is compromised, change your account password immediately by going to HoYoLab Account
This script uses your Token HoYoLab to automatically log into HoYoLab for the games you've selected (like Genshin, Star Rail). It sends check-in requests (API Requests) to HoYoLab's servers, checks the results (Success, Already checked in, or CAPTCHA hit), and then sends a summary of the check-in status and any rewards received to the Discord Webhook you set up.
I used
Gemini advence 2.5 Proto help write a bit of this script.
- main.js is a script meant to be run on your own machine
(e.g., run with vscode). It can't be used directly in Google Apps Script, but the functions are the same. ( Before use, you must installaxiosNode_modules first.) - node_modules are modules only for
main.js, not related toRimuru-gives-you-the-primogems.js - gs The files inside this folder are actually
.gsThese are the scripts for running on Google Apps Script. They can't be run on your machine. There's an English version และ Thai version
Copyright (c) 2025 Nattapat2871
Total Freedom: You can use, modify, share, or even sell this software for free.
One Condition: You must always include the copyright notice and this License text with it.
No Guarantees: The software comes "as is". The creator doesn't promise it will work perfectly.
Not Responsible:: If something goes wrong while using it, the creator isn't responsible for any damages.
Basically: "Do whatever you want with it for free, just keep my name and the license attached. If it breaks or causes problems, that's on you, not me."
19:24 26/6/2025 : Added result image And Contact discord server23:30 25/4/2025 : Added function Multiple Accounts login And Notify Webhooks in more server10:55 25/4/2025 : Added MIT License02:18 25/4/2025 : Fixed Console log Debug slightly23:30 24/4/2025 : Added language selection feature22:46 24/4/2025 : Added check-in function for Tears of Themis16:25 24/4/2025 : First Commit




