Files
lastz-giftcenter-cli/README.md
2026-06-27 23:32:47 +08:00

92 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# lastz-giftcenter-cli
Last-Z Gift Center 的命令列工具,支援查詢帳號資訊、兌換禮品碼,以及查看玩家資料、遊戲公告等。
## 安裝
建議使用虛擬環境Homebrew / PEP 668 的 Python 不允許全域安裝套件):
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
之後每次使用先 `source .venv/bin/activate`,或直接以 `.venv/bin/python giftcenter.py ...` 執行。
## 設定
在專案根目錄建立 `.env` 檔案,填入你的 UID
```
UID=your_uid_here
```
或在執行指令時以 `--uid` 旗標直接指定。
## 使用方式
### 查詢帳號資訊
```bash
python giftcenter.py login
```
輸出範例:
```
登入成功
名稱 : 玩家名稱
UID : 1234567890
SID : S001
國家 : TW
等級 : 50
```
### 兌換禮品碼
```bash
python giftcenter.py redeem <禮品碼>
```
### 查看完整玩家資料
```bash
python giftcenter.py profile
```
輸出範例:
```
名稱 : LoTimmy
UID : 1234567890
總部等級 : 29
戰力 : 160278330
點贊量 : 1586
殺敵數量 : 38984
送禮等級 : 8
稱王次數 : 3
聯盟 : 1945-Govs
聯盟縮寫 : 45GV
```
### 遊戲公告與下載資訊(免 UID
```bash
python giftcenter.py news # 遊戲版本公告
python giftcenter.py info # 地區與最新 APK 下載連結
```
### 指定 UID覆蓋 .env
```bash
python giftcenter.py --uid <uid> login
python giftcenter.py --uid <uid> redeem <禮品碼>
python giftcenter.py --uid <uid> profile
```
## 依賴套件
- [requests](https://docs.python-requests.org/)
- [python-dotenv](https://github.com/theskumar/python-dotenv)