This repository contains scripts to automate the extension of XServer Game VPS instances.
-
Clone the repository:
git clone https://github.com/XCQ0607/Xserver_script.git cd Xserver_script -
Install dependencies:
npm install npx playwright install chrome
-
Configure Users:
- Copy
users.json.templatetousers.json. - Edit
users.jsonand add your account credentials.
[ { "username": "your_email@example.com", "password": "your_password" } ] - Copy
-
Run the script:
node win.js
- The script runs in headless mode by default.
- Screenshots will be saved in the current directory for success (
success_*.png), failure (error_*.png), or skipped (skip_*.png) attempts.
-
Fork this repository to your own GitHub account (
github.com/XCQ0607/Xserver_script). -
Configure Secrets:
- Go to your forked repository's Settings > Secrets and variables > Actions.
- Click New repository secret.
- Name:
USERS_JSON - Value: Paste the content of your
users.jsonfile (minified JSON is preferred but not required).- Example format:
[{"username":"user1@example.com","password":"pass1"},{"username":"user2@example.com","password":"pass2"}]
- Example format:
- (Optional) Telegram Notification:
- Name:
TG_BOT_TOKEN- Your Telegram Bot Token (from @BotFather). - Name:
TG_CHAT_ID- Chat ID to receive notifications (User ID or Group ID). - If configured, the script will send notifications with screenshots upon completion or error.
- Name:
-
Run Workflow:
- The workflow is scheduled to run automatically every 24 hours (00:00 UTC).
- You can also manually trigger it from the Actions tab > XServer Extend Schedule > Run workflow.
-
Check Results:
- Go to the Actions tab and click on the latest run.
- Check the Artifacts section to download screenshots of the process.
- If the "Extend Period" button is not found (e.g., extension not yet available), the script will skip that user and save a screenshot named
skip_<username>.png. - Ensure your
USERS_JSONsecret is valid JSON.