From 9eb509371c2b6093f2b5f0c4d2d0b5d02968d2da Mon Sep 17 00:00:00 2001 From: Sthkm3 Date: Tue, 24 Feb 2026 05:15:23 +0800 Subject: [PATCH] Add files via upload --- README.md | 95 ++++++++++++++++- README_en.md | 101 ++++++++++++++++++ README_zh-CN.md | 98 +++++++++++++++++ src/main.js | 211 +++++++++++++++++++++++++++++++++++++ src/run.js | 273 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 777 insertions(+), 1 deletion(-) create mode 100644 README_en.md create mode 100644 README_zh-CN.md create mode 100644 src/main.js create mode 100644 src/run.js diff --git a/README.md b/README.md index d6117de..e9ff930 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,95 @@ -# AutoCatAndSoup +**| [English](README_en.md) | 繁體中文 | [简体中文](README_zh-CN.md) |** + +# **AutoCatAndSoup** + Cat and Soup auto script | 貓咪與湯輔助腳本,基於Autojs6撰寫和編譯。 + +![icon](https://play-lh.googleusercontent.com/A2Wq3C8LfjxpREC0DccMcYcRIqWB7ol5o3cDhfL3rYS2ZFqOwCB5tFOEOS5Tzya37df7=s180-rw) + +## 功能 + +### 基本任務 + +- **販賣商品**:有商品出現在販賣區時,自動點擊以收取金幣。 +- **設施升級**:在金幣足夠時,升級貓咪們的設施。 +- **食譜升級**:在體力足夠時,升級貓咪們的食譜 (後期食譜滿等可關閉)。 + +### 獎勵領取 + +- **掛機獎勵**:領取離線獎勵 (通常極限為離線六個小時)。 +- **罐子精靈獎勵**:領取隨機罐子精靈獎勵。 +- **商人獎勵**:每天領取兩次商人獎勵。 +- **黃金蝴蝶獎勵**:黃金蝴蝶出現時,定位到該位置後捕捉。 +- **青蛙王子獎勵**:青蛙王子出現時,定位到該位置後領取。 +- **信箱**:領取信箱獎勵。 +- **成就**:領取成就與每日任務獎勵。 + +> **為何有時無法收取黃金蝴蝶和青蛙王子獎勵?** 有時黃金蝴蝶和青蛙王子出現在太靠近邊緣的地方,導致點擊時被遊戲強制拉回視角,目前腳本只依賴顏色判斷,視覺算法對手機來說太繁重而沒有使用。 +> 目前可用的解決辦法是將設施移動到畫面邊緣以防止黃金蝴蝶和青蛙王子出現在太靠近邊緣的地方。 + +### 隨機任務 + +- **拍攝照片**:自動完成拍照任務並關閉結果畫面。 +- **禮物**:領取貓咪們準備的禮物以及追加金幣禮物 (在非免廣告狀態下,將預設選擇中間選項)。 +- **玩耍**:自動與貓咪玩耍以增加親密度。 + +> **會使用到廣告卷嗎?** 不會,只有在免廣告狀態下才會使用廣告加倍。 + +### 每日任務 + +> 未開發,請耐心等待後續更新。 + +## 安裝 + +### 方法一:使用已編譯 APK(推薦) + +1. **前往 Releases 頁面下載最新版本 APK** +2. **將 APK 安裝至手機** +3. **開啟應用後,依照提示啟用:** + - 無障礙服務 + - 懸浮窗權限 + +### 方法二:使用 Auto.js 6 編譯 + +1. **安裝 Auto.js 6(AutoJS6)** +2. **將本專案下載或 clone 至手機** +3. **使用 Auto.js 6 開啟 main.js** +4. **透過 Auto.js 內建功能編譯為 APK 或直接執行** + +## 使用方式 + +1. **開啟本應用** +2. **勾選需要啟用的功能項目** +3. **點擊「啟動」** +4. **暫時啟用螢幕截圖權限** +5. **腳本將自動啟動遊戲並開始運行** +6. **畫面左側會出現浮動視窗,可隨時:** + - 暫停腳本 + - 繼續腳本 + +> 腳本運行中請勿對手機進行操作,請先暫停腳本後再操作。 + +> 如有執行錯誤操作可直接取消勾選該功能。 + +## 環境需求 + +- **Android 裝置** (目前測試環境以模擬器為主,如 Bluestacks、MuMu 12、夜神模擬器等) +- **螢幕解析度:** + - 直向 720 × 1280(目前僅支援此解析度,未來會盡力開發自由解析度) +- **遊戲版本:Cat and Soup 4.28.1** +- **需開啟:** + - 無障礙服務 + - 懸浮窗權限 + - 截圖權限 + +>本專案僅供學習與研究用途,請使用者自行遵守遊戲相關服務條款,因使用本專案所產生之任何風險與後果,概由使用者自行承擔。 + +## 關於 **Auto.js 6** + +本專案基於 Auto.js 6(AutoJS6) 開發與編譯。 +Auto.js 6 是一套 Android 自動化腳本工具,透過 JavaScript 搭配無障礙服務實現點擊、滑動、畫面辨識等操作。 + +本專案: +- 使用 Auto.js 6 作為開發環境與編譯環境 +- 最終產出為可獨立安裝的 APK +- 安裝後可在未安裝 Auto.js 的情況下直接使用 \ No newline at end of file diff --git a/README_en.md b/README_en.md new file mode 100644 index 0000000..56cbfc5 --- /dev/null +++ b/README_en.md @@ -0,0 +1,101 @@ +**| English | [繁體中文](README.md) | [简体中文](README_zh-CN.md) |** + +# **AutoCatAndSoup** + +Cat and Soup auto script | An assistant script for *Cat and Soup*, developed and compiled using Auto.js 6. + +![icon](https://play-lh.googleusercontent.com/A2Wq3C8LfjxpREC0DccMcYcRIqWB7ol5o3cDhfL3rYS2ZFqOwCB5tFOEOS5Tzya37df7=s180-rw) + +## Features + +### Basic Tasks + +- **Sell Products**: Automatically taps to sell products and collect coins when items are available in the selling area. +- **Facility Upgrade**: Automatically upgrades cat facilities when sufficient coins are available. +- **Recipe Upgrade**: Automatically upgrades recipes when enough stamina is available (can be disabled after recipes reach max level). + +### Reward Collection + +- **AFK Reward**: Collects offline rewards (usually up to 6 hours). +- **Jar Fairy Reward**: Collects random Jar Fairy rewards. +- **Merchant Reward**: Collects merchant rewards twice per day. +- **Golden Butterfly Reward**: Locates and captures the Golden Butterfly when it appears. +- **Frog Prince Reward**: Locates and collects the Frog Prince reward when it appears. +- **Mailbox**: Collects mailbox rewards. +- **Achievements**: Collects achievement and daily task rewards. + +> **Why are Golden Butterfly and Frog Prince rewards sometimes not collected?** +> Sometimes they appear too close to the edge of the screen, causing the game camera to snap back when clicking. +> Currently, this script only relies on color detection. Visual recognition algorithms are not used because they are too resource-intensive for mobile devices. +> A temporary workaround is to move facilities closer to the screen edge to prevent these events from spawning too close to the boundary. + +### Random Tasks + +- **Take Photo**: Automatically completes photo tasks and closes the result screen. +- **Gift**: Collects gifts prepared by cats and additional coin rewards (when ads are not removed, the middle option is always selected). +- **Play**: Automatically plays with cats to increase affection. + +> **Will this script consume ad tickets?** +> No. Ad doubling will only be used when the game is in ad-free mode. + +### Daily Tasks + +> Not implemented yet. Please wait for future updates. + +## Installation + +### Method 1: Use Precompiled APK (Recommended) + +1. **Download the latest APK from the Releases page** +2. **Install the APK on your Android device** +3. **After launching the app, enable the following permissions as prompted:** + - Accessibility Service + - Floating Window (Overlay) permission + +### Method 2: Compile with Auto.js 6 + +1. **Install Auto.js 6 (AutoJS6)** +2. **Download or clone this repository to your device** +3. **Open main.js with Auto.js 6** +4. **Compile it into an APK or run it directly using Auto.js** + +## Usage + +1. **Launch the application** +2. **Select the features you want to enable** +3. **Tap “Start”** +4. **Grant temporary screen capture permission** +5. **The script will automatically launch the game and begin running** +6. **A floating control window will appear on the left side of the screen, allowing you to:** + - Pause the script + - Resume the script + +> Do not operate the phone while the script is running. Please pause the script before manual interaction. +> + +> If any incorrect behavior occurs, simply uncheck the corresponding feature. + +## Requirements + +- **Android device** (currently recommended to use emulators such as Bluestacks, Mumu 12, or Nox Player) +- **Screen resolution:** + - Portrait mode: 720 × 1280 + (Currently only this resolution is supported. Flexible resolution support is planned for future versions.) +- **Game version: Cat and Soup 4.28.1** +- **Required permissions:** + - Accessibility Service + - Floating Window (Overlay) + - Screen Capture permission + +> This project is intended for learning and research purposes only. +> Please comply with the game’s terms of service. Use at your own risk. + +## About **Auto.js 6** + +This project is developed and compiled using **Auto.js 6 (AutoJS6)**. +Auto.js 6 is an Android automation scripting tool that uses JavaScript in combination with the Accessibility Service to perform actions such as tapping, swiping, and screen recognition. + +This project: +- Uses Auto.js 6 as the development and compilation environment +- Produces a standalone installable APK +- Can be used without installing Auto.js after compilation \ No newline at end of file diff --git a/README_zh-CN.md b/README_zh-CN.md new file mode 100644 index 0000000..d8a303c --- /dev/null +++ b/README_zh-CN.md @@ -0,0 +1,98 @@ +**| [English](README_en.md) | [繁體中文](README.md) | 简体中文 |** + +# **AutoCatAndSoup** + +Cat and Soup auto script | 猫咪与汤辅助脚本,基于 Auto.js 6 编写与编译。 + +![icon](https://play-lh.googleusercontent.com/A2Wq3C8LfjxpREC0DccMcYcRIqWB7ol5o3cDhfL3rYS2ZFqOwCB5tFOEOS5Tzya37df7=s180-rw) + +## 功能 + +### 基本任务 + +- **贩卖商品**:当贩卖区有商品时,自动点击以收取金币。 +- **设施升级**:当金币足够时,升级猫咪们的设施。 +- **食谱升级**:当体力足够时,升级猫咪们的食谱(后期食谱满级可关闭)。 + +### 奖励领取 + +- **挂机奖励**:领取离线奖励(通常极限为离线六小时)。 +- **罐子精灵奖励**:领取随机罐子精灵奖励。 +- **商人奖励**:每天领取两次商人奖励。 +- **黄金蝴蝶奖励**:黄金蝴蝶出现时,定位到该位置后捕捉。 +- **青蛙王子奖励**:青蛙王子出现时,定位到该位置后领取。 +- **信箱**:领取信箱奖励。 +- **成就**:领取成就与每日任务奖励。 + +> **为什么有时无法收取黄金蝴蝶和青蛙王子奖励?** +> 有时黄金蝴蝶和青蛙王子出现在过于靠近边缘的位置,点击时会被游戏强制拉回视角。目前脚本仅依赖颜色判断,未使用视觉算法(对手机来说运算负担较重)。 +> 目前可行的解决方法是将设施移动到画面边缘,以避免黄金蝴蝶和青蛙王子出现在过于靠近边缘的位置。 + +### 随机任务 + +- **拍摄照片**:自动完成拍照任务并关闭结果画面。 +- **礼物**:领取猫咪们准备的礼物以及追加金币礼物(非免广告状态下一律选择中间选项)。 +- **玩耍**:自动与猫咪玩耍以增加亲密度。 + +> **会使用广告券吗?** 不会,只有在免广告状态下才会使用广告加倍。 + +### 每日任务 + +> 尚未开发,请耐心等待后续更新。 + +## 安装 + +### 方法一:使用已编译 APK(推荐) + +1. **前往 Releases 页面下载最新版本 APK** +2. **将 APK 安装至手机** +3. **打开应用后,根据提示启用:** + - 无障碍服务 + - 悬浮窗权限 + +### 方法二:使用 Auto.js 6 编译 + +1. **安装 Auto.js 6(AutoJS6)** +2. **将本项目下载或 clone 至手机** +3. **使用 Auto.js 6 打开 main.js** +4. **通过 Auto.js 内置功能编译为 APK 或直接运行** + +## 使用方式 + +1. **打开本应用** +2. **勾选需要启用的功能项目** +3. **点击“启动”** +4. **临时授予屏幕截图权限** +5. **脚本将自动启动游戏并开始运行** +6. **屏幕左侧会出现悬浮窗口,可随时:** + - 暂停脚本 + - 继续脚本 + +> 脚本运行中请勿操作手机,如需操作请先暂停脚本。 +> + +> 如出现错误操作,可直接取消勾选对应功能。 + +## 环境需求 + +- **Android 设备**(暂时推荐使用模拟器,如 Bluestacks、Mumu 12、夜神模拟器 等) +- **屏幕分辨率:** + - 竖屏 720 × 1280(目前仅支持此分辨率,未来将尽量开发多分辨率支持) +- **游戏版本:Cat and Soup 4.28.1** +- **需开启:** + - 无障碍服务 + - 悬浮窗权限 + - 截图权限 + +> 本项目仅供学习与研究用途,请遵守游戏相关服务条款,使用风险请自行承担。 + +## 关于 **Auto.js 6** + +本项目基于 Auto.js 6(AutoJS6)开发与编译。 +Auto.js 6 是一套 Android 自动化脚本工具,通过 JavaScript 搭配无障碍服务实现点击、滑动及画面识别等操作。 + +本项目: + +- 使用 Auto.js 6 作为开发环境与编译环境 +- 最终产出为可独立安装的 APK +- 安装后可在未安装 Auto.js 的情况下直接使用 \ No newline at end of file diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..6de85f0 --- /dev/null +++ b/src/main.js @@ -0,0 +1,211 @@ +/** + * 專案名稱: AutoCatAndSoup + * Copyright (C) 2026 Sthkm3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +"ui"; + +importClass(android.provider.Settings); + +// 基本設定 +const STORAGE = storages.create("AutoCatAndSoupConfig"); + +// 設定資料 +let config = { + sellProduct: STORAGE.get("sellProduct", false), + upgradeFacility: STORAGE.get("upgradeFacility", false), + upgradeRecipe: STORAGE.get("upgradeRecipe", false), + Photo: STORAGE.get("Photo", false), + Gift: STORAGE.get("Gift", false), + Play: STORAGE.get("Play", false), + receiveAFK: STORAGE.get("receiveAFK", false), + receiveJar: STORAGE.get("receiveJar", false), + receiveMerchant: STORAGE.get("receiveMerchant", false), + receiveButterfly: STORAGE.get("receiveButterfly", false), + receiveFrog: STORAGE.get("receiveFrog", false), + receiveMail: STORAGE.get("receiveMail", false), + receiveAchievement: STORAGE.get("receiveAchievement", false) +}; + +// 無障礙檢查 +function checkAccessibility() { + if (!auto.service) { + toast("請啟用無障礙服務"); + app.startActivity({ + action: Settings.ACTION_ACCESSIBILITY_SETTINGS + }); + return false; + } + return true; +} + +// UI +ui.layout( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +