Add files via upload

This commit is contained in:
Sahik authored and GitHub committed 2026-02-24 05:15:23 +08:00
1 parent fb96cf6c73
commit 9eb509371c
5 files changed
+777 -1

No files matched your search

+94 -1
View File
@@ -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 的情況下直接使用
+101
View File
@@ -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
+98
View File
@@ -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 的情况下直接使用
+211
View File
@@ -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 <https://www.gnu.org/licenses/>.
*/
"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(
<vertical>
<text text="Auto CatAndSoup 設定" textSize="20sp" textColor="#000000" gravity="center_horizontal" padding="16"/>
<scroll layout_weight="1">
<vertical padding="24">
<text text="── 基本 ──" textColor="#888888"/>
<checkbox id="cbSell" text="販賣商品"/>
<checkbox id="cbUpgrade" text="設施升級"/>
<checkbox id="cbUpgrade2" text="食譜升級"/>
<checkbox id="cbBuild" text="設施建設(未開發)"/>
<space h="16"/>
<text text="── 領取 ──" textColor="#888888"/>
<checkbox id="cbReceive" text="掛機獎勵"/>
<checkbox id="cbReceive2" text="罐子精靈獎勵"/>
<checkbox id="cbReceive3" text="商人獎勵"/>
<checkbox id="cbReceive4" text="黃金蝴蝶獎勵"/>
<checkbox id="cbReceive5" text="青蛙王子獎勵"/>
<checkbox id="cbReceive6" text="信箱"/>
<checkbox id="cbReceive7" text="成就"/>
<space h="16"/>
<text text="─ 隨機任務 ─" textColor="#888888"/>
<checkbox id="cbPhoto" text="拍攝照片"/>
<checkbox id="cbGift" text="禮物"/>
<checkbox id="cbPlay" text="玩耍"/>
<checkbox id="cbTravel" text="旅行(未開發)"/>
<space h="16"/>
<text text="─ 每日任務 ─" textColor="#888888"/>
<checkbox id="cbFishing" text="釣魚(未開發)"/>
<checkbox id="cbGacha" text="扭蛋(未開發)"/>
<checkbox id="cbShooting" text="投籃(未開發)"/>
</vertical>
</scroll>
<button id="btnStart" text="啟動" textSize="18sp" layout_gravity="center_horizontal" margin="16"/>
</vertical>
);
// 初始化狀態
ui.cbSell.checked = config.sellProduct;
ui.cbUpgrade.checked = config.upgradeFacility;
ui.cbUpgrade2.checked = config.upgradeRecipe;
ui.cbPhoto.checked = config.Photo;
ui.cbGift.checked = config.Gift;
ui.cbPlay.checked = config.Play;
ui.cbReceive.checked = config.receiveAFK;
ui.cbReceive2.checked = config.receiveJar;
ui.cbReceive3.checked = config.receiveMerchant;
ui.cbReceive4.checked = config.receiveButterfly;
ui.cbReceive5.checked = config.receiveFrog;
ui.cbReceive6.checked = config.receiveMail;
ui.cbReceive7.checked = config.receiveAchievement;
// 未開發功能鎖定
ui.cbBuild.enabled = false;
ui.cbTravel.enabled = false;
ui.cbFishing.enabled = false;
ui.cbGacha.enabled = false;
ui.cbShooting.enabled = false;
// 勾選監聽
ui.cbSell.on("check", checked => {
config.sellProduct = checked;
STORAGE.put("sellProduct", checked);
});
ui.cbUpgrade.on("check", checked => {
config.upgradeFacility = checked;
STORAGE.put("upgradeFacility", checked);
});
ui.cbUpgrade2.on("check", checked => {
config.upgradeRecipe = checked;
STORAGE.put("upgradeRecipe", checked);
});
ui.cbPhoto.on("check", checked => {
config.Photo = checked;
STORAGE.put("Photo", checked);
});
ui.cbGift.on("check", checked => {
config.Gift = checked;
STORAGE.put("Gift", checked);
});
ui.cbPlay.on("check", checked => {
config.Play = checked;
STORAGE.put("Play", checked);
});
ui.cbReceive.on("check", checked => {
config.receiveAFK = checked;
STORAGE.put("receiveAFK", checked);
});
ui.cbReceive2.on("check", checked => {
config.receiveJar = checked;
STORAGE.put("receiveJar", checked);
});
ui.cbReceive3.on("check", checked => {
config.receiveMerchant = checked;
STORAGE.put("receiveMerchant", checked);
});
ui.cbReceive4.on("check", checked => {
config.receiveButterfly = checked;
STORAGE.put("receiveButterfly", checked);
});
ui.cbReceive5.on("check", checked => {
config.receiveFrog = checked;
STORAGE.put("receiveFrog", checked);
});
ui.cbReceive6.on("check", checked => {
config.receiveMail = checked;
STORAGE.put("receiveMail", checked);
});
ui.cbReceive7.on("check", checked => {
config.receiveAchievement = checked;
STORAGE.put("receiveAchievement", checked);
});
// 啟動
ui.btnStart.on("click", () => {
if (!checkAccessibility()) return;
STORAGE.put("sellProduct", config.sellProduct);
STORAGE.put("upgradeFacility", config.upgradeFacility);
STORAGE.put("upgradeRecipe", config.upgradeRecipe);
STORAGE.put("Photo", config.Photo);
STORAGE.put("Gift", config.Gift);
STORAGE.put("Play", config.Play);
STORAGE.put("receiveAFK", config.receiveAFK);
STORAGE.put("receiveJar", config.receiveJar);
STORAGE.put("receiveMerchant", config.receiveMerchant);
STORAGE.put("receiveButterfly", config.receiveButterfly);
STORAGE.put("receiveFrog", config.receiveFrog);
STORAGE.put("receiveMail", config.receiveMail);
STORAGE.put("receiveAchievement", config.receiveAchievement);
ui.finish();
engines.execScriptFile("run.js");
});
// 啟動時提醒無障礙
setTimeout(() => {
checkAccessibility();
}, 300);
+273
View File
@@ -0,0 +1,273 @@
/**
* 專案名稱: 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 <https://www.gnu.org/licenses/>.
*/
"auto";
const STORAGE = storages.create("AutoCatAndSoupConfig");
const SCREEN_W = 720;
const SCREEN_H = 1280;
// 讀取
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)
};
// 小視窗
let isPaused = false;
let win = floaty.rawWindow(
<vertical bg="#AA000000" padding="6">
<text text="Auto CatAndSoup" textColor="#FFFFFF" textSize="12sp"/>
<button id="btnPause" text="暫停"/>
</vertical>
);
win.setPosition(0, (SCREEN_H / 2) - 80);
win.setSize(160, -2); win.btnPause.click(() => { isPaused = !isPaused;
win.btnPause.setText(isPaused ? "啟動" : "暫停");
toast(isPaused ? "已暫停" : "已啟動"); });
// 主循環
while (true) {
var img = captureScreen();
var pkg = currentPackage();
// 判斷應用
if (pkg != "com.hidea.cat" && !isPaused) {
app.launchPackage("com.hidea.cat");
sleep(1000);
continue;
}
// 販賣商品
if (config.sellProduct && !isPaused) {
if (
!images.detectsColor(img, "#B38282", 35, 1264) &&
!images.detectsColor(img, "#DCAB82", 35, 1264)
) {
let x = random(30, 90);
let y = random(1200, 1240);
click(x, y);
sleep(200);
}
}
// 設施升級
if (config.upgradeFacility && !isPaused) {
if (images.detectsColor(img, "#70FE7F", 95, 1024)) {
click(31, 1044);
sleep(200);
}
}
// 食譜升級
if (config.upgradeRecipe && !isPaused) {
if (images.detectsColor(img, "#FD7171", 581, 1081)) {
click(550, 1101);
sleep(500);
var img = captureScreen();
while (images.detectsColor(img, "#8EE3D3", 458, 1037)){
click(458, 1081);
sleep(100);
var img = captureScreen();
}
//back();
sleep(3000);
}
}
// 拍照
if (config.Photo && !isPaused) {
if (images.detectsColor(img, "#B5B5C6", 648, 813)){
click(660, 815);
sleep(1000);
click(362, 1026);
sleep(1000);
back();
sleep(500); //images.detectsColor(img, "#FF6F6F", 681, 796)
}
}
// 禮物
if (config.Gift && !isPaused) {
if (images.detectsColor(img, "#FFFFFF", 680, 725) && images.detectsColor(img, "#FFFFFF", 680, 715)) {
click(662, 745);
var img = captureScreen();
while (!images.detectsColor(img, "#FFFFFF", 250, 825)){
sleep(100);
var img = captureScreen();
}
sleep(500);
click(360, 760);
sleep(500);
back();
sleep(2000);
var img = captureScreen();
if (images.detectsColor(img, "#FFFFFF", 250, 830)){
click(360, 735);
sleep(3000);
back();
}
sleep(500);
}
}
// 玩耍
if (config.Play && !isPaused) {
if (images.detectsColor(img, "#F9DBDC", 673, 737)) {
click(645, 739);
sleep(3000);
click(360, 800);
sleep(500);
swipe(360, 560, 360, 900, 1000);
sleep(100);
var img = captureScreen();
while(images.detectsColor(img, "#F2B1B1", 501, 858) && !isPaused){
swipe(360, 800, 360, 200, 3000);
sleep(100);
swipe(360, 300, 360, 900, 3000);
sleep(100);
var img = captureScreen();
}
click(415, 923);
sleep(1000);
}
}
// 掛機獎勵
if (config.receiveAFK && !isPaused) {
if (images.detectsColor(img, "#E3C5AE", 371, 1092)) {
click(360, 1130);
sleep(500);
click(420, 809);
sleep(500);
}
}
// 罐子精靈獎勵
if (config.receiveJar && !isPaused) {
if (images.detectsColor(img, "#AAAAAA", 433, 1132)) {
click(360, 1130);
sleep(500);
click(420, 844);
sleep(500);
}
}
// 商人獎勵
if (config.receiveMerchant && !isPaused) {
if (images.detectsColor(img, "#DB937D", 351, 1152)) {
click(360, 1130);
sleep(500);
click(420, 755);
sleep(500);
}
}
// 黃金蝴蝶獎勵
if (config.receiveButterfly && !isPaused) {
if (images.detectsColor(img, "#FBE771", 71, 280)) {
click(71, 280);
sleep(2000);
click(360, 650);
sleep(300);
click(423, 724);
sleep(500);
}
}
// 青蛙王子獎勵
if (config.receiveFrog && !isPaused) {
if (images.detectsColor(img, "#D8E0B7", 55, 291) && images.detectsColor(img, "#D8E0B7", 49, 291)) {
click(71, 280);
sleep(2000);
click(360, 650);
sleep(300);
click(423, 724);
sleep(500);
}
}
// 信箱
if (config.receiveMail && !isPaused) {
if (images.detectsColor(img, "#FFFFFF", 376, 199) && images.detectsColor(img, "#F2DFC7", 356, 234)) {
click(360, 208);
sleep(1000);
var img = captureScreen();
while (images.detectsColor(img, "#8EE3D3", 570, 380) && !isPaused) {
click(484, 398);
sleep(500);
var img = captureScreen();
if (images.detectsColor(img, "#E5D8CA", 489, 632)) {
click(400, 720);
var img = captureScreen();
}
sleep(500);
var img = captureScreen();
}
back();
sleep(500);
}
}
// 成就與任務
if (config.receiveAchievement && !isPaused) {
if (images.detectsColor(img, "#FF6F6E", 680, 243)) {
click(662, 263);
sleep(500);
var img = captureScreen();
if (images.detectsColor(img, "#FF6F6E", 307, 234)) {
click(225, 250);
sleep(1000);
while (images.detectsColor(img, "#8EE3D3", 520, 460) && !isPaused) {
click(520, 470);
sleep(100);
var img = captureScreen();
}
}
else {
click(495, 250);
sleep(1000);
while (images.detectsColor(img, "#8EE3D3", 520, 344) && !isPaused) {
click(520, 344);
sleep(100);
var img = captureScreen();
}
}
back();
sleep(500);
}
}
img.recycle();
}