⚡ A person who is passionate about technologies, open-source, reverse engineering, convenience, etc.
- en-US / jp-JP
- Programmer / Developer
- Likes to collect stuff
✨ If you like my projects, you can buy me a coffee at:
Auto check-in and others for Honkai: Star Rail
Home Page: https://ko-fi.com/torikushiii
License: GNU Affero General Public License v3.0
Hello, I noticed that codes don't seem to be redeeming for me and reminders to do my dailies don't pop up.
Everything else seems to be functional however (Stamina Threshold/Check In)/Expeditions Reminders)
I have code redemption and check code set to true so i am unsure if I have an issue or something else
Please advise thank you!
Boothill banner dropped yesterday and we have a new code: FA2CU3P7P6QT
My scritp still running and it doesnt redeem new code, is there something changed? It was working fine for me in the last few month.
The complete error code is here
2023-12-31 00:00:00 TypeError: Cannot read properties of undefined (reading 'name')
2023-12-31 00:00:00 at Cron.checkInChecker (file:///usr/src/app/crons/check-in-checker/index.mjs:22:31)
2023-12-31 00:00:00 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-01-02 00:00:01 message: 'API error when signing',
2024-01-02 00:00:01 args: {
2024-01-02 00:00:01 statusCode: 200,
2024-01-02 00:00:01 body: {
2024-01-02 00:00:01 data: null,
2024-01-02 00:00:01 message: 'Too many attempts. Please try again later.',
2024-01-02 00:00:01 retcode: -500004
2024-01-02 00:00:01 }
2024-01-02 00:00:01 }
2024-01-02 00:00:01 }
Error after adding add checkInChecker
is it possible to add them back? I prefer to check them manually to integrate with my other scripts.
Hello author, I am a Hong Kong, Macao and Taiwan server player, I see that there is no Hong Kong, Macao and Taiwan server in your code
out of 4 accounts, only one works as of right now. I tried regenerating tokens by logging out and logging in an incognito tab, but I receive the same error:
2024-05-30 12:28:14 [INFO]: { message: 'API error when getting stamina info', args: { statusCode: 200, body: { data: null, message: '', retcode: 10035 } } }
any clue will be of great help
After using the new Discord.js code, I encountered the following error
2023-12-28 11:11:00 RequestError: Response code 400 (Bad Request)
2023-12-28 11:11:00 - args: {"statusCode":400,"statusMessage":"Bad Request","hostname":"discord.com"}
2023-12-28 11:11:00 at Request._destroy (file:///usr/src/app/node_modules/got/dist/source/core/index.js:482:21)
2023-12-28 11:11:00 at _destroy (node:internal/streams/destroy:109:10)
2023-12-28 11:11:00 at Request.destroy (node:internal/streams/destroy:71:5)
2023-12-28 11:11:00 at Request._error (file:///usr/src/app/node_modules/got/dist/source/core/index.js:1012:14)
2023-12-28 11:11:00 at gotModule.extend.hooks.beforeError (file:///usr/src/app/lib/got.js:18:11)
2023-12-28 11:11:00 at Request._error (file:///usr/src/app/node_modules/got/dist/source/core/index.js:1005:35)
2023-12-28 11:11:00 at file:///usr/src/app/node_modules/got/dist/source/core/index.js:402:23
2023-12-28 11:11:00 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
2023-12-28 11:11:00 input: undefined,
2023-12-28 11:11:00 code: 'ERR_GOT_REQUEST_ERROR',
I can run the bot without issues using the old code, but after switching to the new Discord.js code, I encounter errors. I'm having trouble pinpointing the issue. Can you help me? I'm launching it using Docker
Commands are unable to be imported on Windows due to a suppressed error. The following error is suppressed in index.js
:
Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:
This occurs on Windows 11, Node.js v18.16.1.
So I followed all instructions, set the stamina threshold = 10
to test.
I run the script and the daily logging
works but the stamina notification
doesn't seem to work, nothing is sent, I tested the webhook link before and it was working.
is there any way I can test or am I missing something?
edit: I found out I had to use node index.js --stamina
to run stamina script, but it gave me this error:
CustomError: API error when getting stamina info
- args: {"statusCode":200,"body":{"data":null,"message":"角色信息错误","retcode":1009}}...
maybe because I am not on the Asia server?
edit2: I figured out by looking at the code: the notification only triggers when it's run by cron. My only issue is the stamina API error.
final edit: After some googling I found out that the api is using a asia server, I only needed to change the server parameters to: server: "prod_official_usa"
. this solved the issue :)
So I tried to get this to run for a while and it just doesn't seem to really do anything?
All I get when running node index.js is
PS C:\Users\Anwender\Documents\starrail-auto-master> node index.js
2023-06-08 23:33:44 [INFO]: Starting cronjobs...
2023-06-08 23:33:44 [INFO]: All cronjobs started successfully!
...and nothing else happens, I set up the config with my cookie and discord webhook url as well to see if the notifs were working
anything I'm missing here?
I really like how simple and easy this is and the integration with discord and I was wondering if editing some things in the script would be easy enough for me (not very tech-y) to do or—
I noticed that with the values: staminaCheck: true
, enabled: true
, skipCheck: false
- notifications about completed expeditions are not sent to telegram, but if I change skipCheck: true
, then notifications start coming, but this is not exactly what I would like.
Also, telegram commands for manually requesting the status of expeditions/stamina do not work for me. I thought that maybe the problem is in the language of the requested site in cookies, but by changing mi18nLang: en-us
nothing has changed
I can't attach any logs because there aren't any (or I don't know where the output is going). If you have time, then consider running the script in debug mode or something similar so that the user can see for himself what happens in case of errors, as well as provide you with more detailed information. Maybe there is some kind of startup key in nodejs, but I do not know.
Anyway, thanks a lot for your work, your script is very useful even when I run into any problems.
First of all, thank you for implementing this automation.
I've been running this for a few months with github action workflow setup.
It'd be nice to have Github Actions integration; people will be able setup their automation by following steps:
This will be applicable only with --sign
flag because the workflow only runs short process.
I'm willing to work on this if it's ok for you.
Adding the missing 'prepareMessage' function similar to 'stamina' will allow the program to run properly
for (const data of expeditionResult) {
const embed = await
sr.Discord.prepareMessage(data, { expedition: true });
await sr.Discord.send(embed);
}
hey, i have a request, i want to do genshin impact to with APPS SCRIPT google, can you guys make it?
I got this error message when try to run
I put the right cookie from hoyolab, but the console alway return please login
`file:///E:/CodeSpace/starrail-auto/core/classes/account.js:94
throw new sr.Error({
^
CustomError: Account 1 is invalid.
Node.js v20.10.0`
Thank for care and pls help
hello. i'm using Google Apps Script, as i only need the auto check in function, and I've noticed that the text says that the cookie should look like this in the end:
_MHYUUID=xxxx ; mi18nLang=en-us ; ltoken=xxxx ; ltuid=xxxx ; cookie_token=xxxx ; account_id=xxxx
however, there is no cookie_token anywhere in the result i get with document.cookie.
Here's what i get when i type document.cookie in the console (obviously i'm changing values into XXXX):
G_AUTHUSER_H=X; _MHYUUID=XXXX; DEVICEFP_SEED_ID=XXXX; DEVICEFP_SEED_TIME=XXXX; G_ENABLED_IDPS=google; mi18nLang=en-us; HYV_LOGIN_PLATFORM_OPTIONAL_AGREEMENT={XXXX:[]}; account_mid_v2=XXXX; account_id_v2=XXXX; ltmid_v2=XXXX; ltuid_v2=XXXX; DEVICEFP=XXXX; mi18nLang=en-us; HYV_LOGIN_PLATFORM_TRACKING_MAP={XXXX:{XXXX}}; HYV_LOGIN_PLATFORM_LIFECYCLE_ID={XXXX}
no cookie_token anywhere. so i have no idea what i have to put there exactly.
i'm using google chrome, latest version, but i've tried on firefox too and there's even less stuff there... i'm lost. it tells me [Error: Info API error: Not logged in] if i try to run it. nothing i've tried works. what am i supposed to do?
i'm a EU player btw, if it's useful.
i've also tried pasting the cookie exactly as it is and running but it still says the same thing. i am logged in on hoyoverse.
Got this error:
PS E:\starrail-auto-master> node index.js
file:///E:/starrail-auto-master/config.js:18
DISCORD_WEBHOOK: discord.com/api/webhooks/1134598997089210368/roB9lo4X-2VQ82ntHBo-SUl-vg9VhBFKwkZwjZO7a3xDF32snCjbePahKIeiMzF2mHTg, // Discord webhook URL
^
SyntaxError: Invalid or unexpected token
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
Node.js v18.12.1
hello,
I tried to run the script on Google API Script as the guide below:
https://github.com/torikushiii/starrail-auto/tree/master/services/google-script
But then I got the message:
2:05:56 PM Error [Error: Info API error: Not logged in]
I also tried with other accounts and got the same message. Can you help me with this?
I followed all the steps and assumed there was nothing wrong with the process, but somehow I could not log in with the cookie.
message: 'API error when getting sign info',
args: {
statusCode: 200,
body: { data: null, message: 'Not logged in', retcode: -100 }
}
Do you have any idea of how this could go wrong? The cookie should be right, I even tried to logout and login again.
So I ran into the Issue that I at first couldn't find the config.js because it either no longer exists or its a typo in the readme.
I was also confused by this wording:
Copy name and value (ltoken_v2 and ltuid_v2) and put it in your config.js file like this format name=value;
- Remember to put "; (semicolon)" at every the end of value, e.g ltoken_v2=abc; ltuid_v2=123
Since it tells me (a developer maybe it's literally just a me being developer issue) to create 2 new variables in the config.js file so something like this:
ltuid_v2 = 123;
ltoken_v2= "abc"
But since it is now under the config.json in the accounts object array in the cookie string I would change the wording to something like this:
Copy name and value (
ltoken_v2
andltuid_v2
) and put it in your config.json file under the accounts list into the cookie with the format beingname=value
If done correctly it should look similar to this:
cookie: "ltuid_v2=123;ltoken_v2=abc"
- Remember to put "; (semicolon)" at every the end of value, e.g ltoken_v2=abc; ltuid_v2=123
Hello !
Do you know if we can manage to make it work with https://script.google.com/ ?
I found one who works with google script but its not as good as yours since it didnt tell me wich reward i got :D
Hello,
I'm using the google script version of this script. I have a question. I heard that cookies data shouldn't be shared with anyone as anyone with my cookie can login into my hoyolab account.
How can we set up environmental variables in google script? Or there is nothing to worry about as my project in google script is private and no one can view my secret values. I have never used Google Script before that's why I am really confused.
Waiting for your response and thankyou.
There used to be a Genshin Daily Check-in script that had the ability to work with several cookies, separated by commas. I wonder if you'll be able to add the same functionality to this script as well? Thank you for your work!
Hello i follow all instruction in the config.js but don't work when i launch command: node index.js
I copied Cookie using Microsoft Edge and pasted into config.js
but when i do node index.js
give me this error:
node:internal/modules/esm/resolve:255
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\SR Auto\starrail-auto\config.js' imported from D:\SR Auto\starrail-auto\core\classes\config.js
at finalizeResolution (node:internal/modules/esm/resolve:255:11)
at moduleResolve (node:internal/modules/esm/resolve:908:10)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///D:/SR%20Auto/starrail-auto/config.js'
}
Node.js v20.10.0
How i can resolve this problem?
I'm trying to get this to work but not having any success. I'm pretty much a noob when it comes to scripting so I bet I did something wrong.
Newest code doesn't seems to for me, 6T3F5HVD6LK7. 19/Jun.
The code from 07/Jun worked just fine.
Edit: Auto redeem worked for me again after making this issue.
I re-pulled the code and ran it using Docker as instructed. I found that if code.js is missing, check-code-redeem will not run or execute. If code.js is present, it runs and helps redeem the code, but it does not write to code.js and there is no notification
Hi! so i decided to update to the latest commits but so far i am trying to run the code but it keeps giving me errors:
const id = account.cookie.match(/account_id=(\d+)/)[1];
TypeError: Cannot read properties of null (reading '1')
at Account class I think.
all i did was:
What exactly is the Syntax for the scheduler? From the example I only managed to figure out:
? | hours/minutes | ? | ? | day of week starting at Sunday | ?
I copied the output from the console and pasted it in the cookies property but when I run it shows this
2023-08-12 13:22:19 [WARN]: Account 1 has no account_id in cookie. Skipping fetching account data...
I have a server on archlinux, on which the script runs without problems. When migrating config.json to another machine, for example, on wsl2 (ubuntu and arch) or Docker on another hardware, an API error occurs. Both computers have Node v21.6.2 installed.
Here's what the script writes when trying to get data on new computer with wsl2 archlinux:
{
message: 'API error when getting stamina info',
args: {
statusCode: 200,
body: { data: null, message: 'invalid request', retcode: -10001 }
}
}
Here's what the script writes on the old computer without errors
It would seem that the problem is with cookies, but my friend sent me a token that was made on a completely different hardware in a completely different place, and it works.
instead of stopping the script when there is a connection error, why not keep it running?
file:///C:/Users/ferna/Desktop/programming/js/starrail-auto/lib/apps/stamina.js:95
throw new Error({
^
CustomError: Error when getting stamina info
- args: {"statusCode":500,"body":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>500 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nThe Lambda@Edge service is currently experiencing problems.\nWe can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear=\"all\">\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: OO3WngBLDQnol-i9D-ZpSG6Kxe3bAQ-_qkziAiZHs-AhEXnlOeYogw==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>"}
at Stamina.run (file:///C:/Users/ferna/Desktop/programming/js/starrail-auto/lib/apps/stamina.js:95:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async CJ.<anonymous> (file:///C:/Users/ferna/Desktop/programming/js/starrail-auto/index.js:49:19) {
[cause]: undefined
}
at title said, i did not notice that i set the setting to false so when the check stamina notification start anoying me i go into config.json to switch it to false to only found out its already false, also it double send the stamina notification,
(unrelated to title, is there a way to change the time for check in from 12 am to 4 am?)
I tested and it seems the daily claims are made at 12:00 am every day (a notification to my discord is sent via web-hooks)
but the stamina one does not seem to send anything>? I see the logs and the cron-job does trigger but I am unable to see any discord notification? even though I set the stamina threshold to a number lower than my current stamina:
example:
Stamina for UID 6XXXXXXXX is above the threshold (137/180) - Capped in 4 hr, 16 min, 57 sec
the threshold does trigger but no notification is sent?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.