diff --git a/.gitignore b/.gitignore index 9374cdb..7e2a35c 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,8 @@ /players/bot.zip /common/proxinject /log -/account \ No newline at end of file +/account +/config.json +/mjai/bot/mortal.pth +/mjai/bot/libriichi.* +/mjai/bot_3p \ No newline at end of file diff --git a/README.md b/README.md index 38b8504..b8abcc1 100644 --- a/README.md +++ b/README.md @@ -35,65 +35,46 @@ https://github.com/shinkuan/RandomStuff/assets/35415788/ce1b598d-b1d7-49fe-a175- ## Setup -### Installation, I suggest you watch the video. +### Installation. -### Some content are outdated: -- You don't need to install mjai now. -- You need to install chromium if you want to use playwright: `playwright install chromium` - -[YouTube Video for you to follow.](https://youtu.be/ZN3qbMyZeus) +[YouTube Video for you to follow.](https://youtu.be/NdAULJgBJ-U) ### You will need: -1. Docker -2. Proxifier or something that can redirect connection to mitmproxy. - 1. __Remember to trust mitmproxy's Certificate!!!__ Don't know how? Google it. -3. A `bot.zip` that contains the AI. [Examples](https://github.com/smly/mjai.app/tree/main/examples) -4. (Optional, Recommend) Use Windows Terminal to open client.py for a nice looking TUI. - -__Don't know how to make a bot.zip yourself? Don't worry!__ - -__Get bot.zip at [Discord](https://discord.gg/Z2wjXUK8bN)__ - -### Docker: -1. Install Docker on your PC -2. `docker pull smly/mjai-client:v3` +1. A `mortal.pth`. [(Get one from Discord server if you don't have one.)](https://discord.gg/Z2wjXUK8bN) +2. A `libriichi` that match your system. [(Get it here)](https://github.com/shinkuan/Akagi/releases/tag/v0.1.0-libriichi) +3. (Optional, Recommend) Use Windows Terminal to open client.py for a nice looking TUI. +4. (Optional) If you want to use Steam, Majsoul Plus, or anything other client, proxy the client using tools like proxifier. + +__Get mortal.pth at [Discord](https://discord.gg/Z2wjXUK8bN)__ +1. Go to #verify and click the ✅ reaction. +2. Go to #bot-zip +3. Download a bot you like. +4. Extract the zip. +5. And mortal.pth is there. ### Akagi: Download `install_akagi.ps1` at [Release](https://github.com/shinkuan/Akagi/releases/latest) -1. Place `install_akagi.ps1` at the folder you want to install Akagi. -2. Open Powershell as admin. -3. Go to the folder. -4. To prevent your PC restrict from executing powershell script, run: - - `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` -5. Run `install_akagi.ps1` -6. put `bot.zip` into ./players folder - -### if `install_akagi.ps1` not working for you: - -Follow the [video](https://youtu.be/ZN3qbMyZeus). - -1. `git clone this` -2. `cd into this repo` -3. Create a Python Virtual Env `python -m venv venv` -4. Activate it. `.\venv\Scripts\activate` -5. `pip install -r requirement.txt` -6. `playwright install chromium` -7. put `bot.zip` into ./players folder - -### Run - -After you __activate the venv__: -1. Configure your setting at `setting.json` -2. `python mitm_playwright.py` or `python mitm.py` -3. `python client.py` +1. Put `install_akagi.ps1` at the location you want to install Akagi. +2. Open **Powershell** as **Administrator** +3. cd in to the directory +4. Run: `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` +5. Run: `install_akagi.ps1` +6. Open mitmproxy if this is your first time using it. +7. Close it. +8. Go to your user home directory `~/.mitmproxy` +9. Install the certificate. +10. Put `libriichi` into `./Akagi/mjai/bot` and rename it as `libriichi` +11. Put `mortal.pth` into `./Akagi/mjai/bot` ### settings.json - `Unlocker`: Decide to use [MajsoulUnlocker](https://github.com/shinkuan/MajsoulUnlocker) or not. - `v10`: If your Majsoul client in still in v0.10.x and you want to use MajsoulUnlocker, set it to true. - `Autoplay`: Autoplay. + - `Helper`: To use [mahjong-helper](https://github.com/EndlessCheng/mahjong-helper) or not + - `Autohu`: Auto Ron. - `Port`: - `MITM`: The MITM Port, you should redirect Majsoul connection to this port. - `XMLRPC`: The XMLRPC Port. @@ -126,7 +107,7 @@ On top right is the MJAI Messages, this is the message our bot sent back to us, Then below is our tehai, it is composed using unicode characters. -Bottom left is the settings. (WIP, currently you should change settings via settings.json) +Bottom left is the settings. Bottom right is the bot's action. @@ -145,6 +126,8 @@ Following guide can minimum the probility of account suspension. ### There is no way to guarantee 100% no account suspension currently. # TODO + - [x] 3 Player Mahjong + - Already done, but not planned to release yet. - [x] Change Setting inside application. - [x] Autoplay - [ ] Auto use stickers to make opponent think we are not a bot. @@ -179,7 +162,7 @@ Following guide can minimum the probility of account suspension. ETH Mainnet: 0x83095C4355E43bDFe9cEf2e439F371900664D41F -Paypal or Others: Maybe? Contact me. +Paypal or Others: Contact me on Discord. You can find me at [Discord](https://discord.gg/Z2wjXUK8bN). @@ -204,8 +187,12 @@ Next, you can find me on Discord, where I will assign you a donor role. # Special Thanks +[Equim-chan/Mortal](https://github.com/Equim-chan/Mortal) + [Majsoul Mod Plus](https://github.com/Avenshy/majsoul_mod_plus) +[mahjong-helper](https://github.com/EndlessCheng/mahjong-helper) + [MahjongRepository/mahjong_soul_api](https://github.com/MahjongRepository/mahjong_soul_api) [smly/mjai.app](https://github.com/smly/mjai.app) diff --git a/README_CH.md b/README_CH.md index 1cf297d..86b3f28 100644 --- a/README_CH.md +++ b/README_CH.md @@ -35,64 +35,43 @@ https://github.com/shinkuan/RandomStuff/assets/35415788/ce1b598d-b1d7-49fe-a175- ### 安裝 -[點我到Youtube觀看安裝影片](https://youtu.be/ZN3qbMyZeus) +[點我到Youtube觀看安裝影片](https://youtu.be/NdAULJgBJ-U) 在開始前,你需要以下東西: -1. Docker -2. Proxifier或任何可以將雀魂連線導向到MITM Proxy的工具。 - 1. __記得要信任mitmproxy的憑證!!!__ 不要問我怎麼做。去問Google。 -3. 一個`bot.zip`。 [Examples](https://github.com/smly/mjai.app/tree/main/examples) -4. (Optional) 推薦使用Windows Terminal,以獲得預期中的UI效果。 +1. `mortal.pth` [(如果你沒有的話,到Discord去下載)](https://discord.gg/Z2wjXUK8bN) +2. `libriichi` [(到這邊根據你的平台下載對應版本)](https://github.com/shinkuan/Akagi/releases/tag/v0.1.0-libriichi) +3. (Optional) 推薦使用Windows Terminal,以獲得預期中的UI效果。 +4. (Optional) 如果你要使用Steam或Majsoul Plus之類的,請使用類似Proxifier的軟體將連線導向至MITM -__不知道如何製作bot.zip嗎?不用擔心!__ +__到[Discord](https://discord.gg/Z2wjXUK8bN)下載我提供的mortal.pth__ +1. 到 #verify 頻道點擊 ✅ 驗證身分. +2. 到 #bot-zip +3. 選一個你喜歡的bot下載 +4. 解壓縮 -__到[Discord](https://discord.gg/Z2wjXUK8bN)下載我提供的bot.zip__ - -Docker: -1. 安裝Docker Desktop -2. 在cmd輸入`docker pull smly/mjai-client:v3` - -Akagi: - -### 影片部分內容已過時: -- 現在已經有自動化安裝 `install_akagi.ps1` -- 現在你不再需要安裝mjai -- 如果你想使用playwright記得安裝chromium: `playwright install chromium` +### Akagi: 到[Release](https://github.com/shinkuan/Akagi/releases/latest)下載`install_akagi.ps1` -1. 把`install_akagi.ps1`放到你想安裝的位置 -2. 以管理員開啟Powershell -3. cd到安裝位置 -4. 有些電腦會限制Powershell腳本的執行,這也是為什麼我們需要管理員權限,執行以下指令以讓腳本能夠運行: - - `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` -5. 執行 `install_akagi.ps1` -6. 將`bot.zip`放入 ./players - -### 如果 `install_akagi.ps1` 有問題: - -建議你跟著[影片](https://youtu.be/ZN3qbMyZeus)中的教學安裝。 - -1. 下載這個Repo到你電腦內,或在cmd輸入`git clone ` -2. 在cmd輸入`cd Akagi`進到資料夾 -3. 創建一個Python venv `python -m venv venv` -4. 啟動它. `.\venv\Scripts\activate` -5. `pip install -r requirement.txt` -6. `playwright install chromium` -7. put `bot.zip` into ./players folder - -### 執行 - -在**啟動venv**後: -1. 在`setting.json`調整設定 -2. `python mitm_playwright.py` or `python mitm.py` -3. `python client.py` +1. 將 `install_akagi.ps1` 放在您想安裝Akagi的位置。 +2. 以**管理員**身份打開 **Powershell** +3. cd 到該目錄 +4. 執行: `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` +5. 執行: `install_akagi.ps1` +6. 如果這是您第一次使用mitmproxy,請打開它。 +7. 關閉它。 +8. cd 到用戶主目錄 `~/.mitmproxy` +9. 安裝證書。 +10. 將 `libriichi` 放入 `./Akagi/mjai/bot` 並將其重新命名為 `libriichi` +11. 將 `mortal.pth` 放入 `./Akagi/mjai/bot` ### settings.json - `Unlocker`: 使用 [MajsoulUnlocker](https://github.com/shinkuan/MajsoulUnlocker) - `v10`: 如果你的客戶端還在v0.10.x版本而且你想要使用MajsoulUnlocker,設為true - `Autoplay`: 自動打牌. + - `Helper`: [mahjong-helper](https://github.com/EndlessCheng/mahjong-helper) + - `Autohu`: Auto Ron. - `Port`: - `MITM`: MITM Port, 你應該將雀魂連線導向到這個Port. - `XMLRPC`: The XMLRPC Port. @@ -125,7 +104,7 @@ LiqiProto訊息隨後被轉錄為mjai格式並發送給機器人。 然後下方是我們的手牌,它是使用Unicode字符組成的。 -左下角是設置。(目前還未完成,你應該通過settings.json來更改設置) +左下角是設置。 右下角是機器人的動作。 @@ -146,9 +125,10 @@ LiqiProto訊息隨後被轉錄為mjai格式並發送給機器人。 ### 目前沒有任何辦法保證完全不封號。 # TODO - + - [x] 三麻模式 + - 已完成,但尚未決定公布。 - [x] 在應用程式內更改Setting。 - - [x] 自動打牌 - (能運作,但 __不__ 穩定) + - [x] 自動打牌 - [ ] 自動使用貼圖,讓對手認為我們不是機器人。 - [ ] 在settings.json中添加隨機時間,讓用戶選擇他們想要的時間。 - [ ] 混合多個AI的決策,讓我們看起來更像人類,而不是完美的機器人。 @@ -181,17 +161,11 @@ LiqiProto訊息隨後被轉錄為mjai格式並發送給機器人。 ETH Mainnet: 0x83095C4355E43bDFe9cEf2e439F371900664D41F -Paypal或其他: Maybe? Contact me. +Paypal或其他: 到Discord找我 You can find me at [Discord](https://discord.gg/Z2wjXUK8bN). -### 斗內後我能得到什麼? - -首先,非常感謝您願意支持作者。 - -我會優先考慮捐款者的意見,比如功能要求和錯誤修復。 - -接下來,您可以在Discord上找到我,我會給您指定一個捐款者身分組。 +![image](https://github.com/shinkuan/RandomStuff/assets/35415788/2b500d5c-21cd-422c-9684-50477835fe13)