diff --git a/.ipynb_checkpoints/RELEASE-checkpoint.md b/.ipynb_checkpoints/RELEASE-checkpoint.md
index ecb92f2..97d7ef4 100644
--- a/.ipynb_checkpoints/RELEASE-checkpoint.md
+++ b/.ipynb_checkpoints/RELEASE-checkpoint.md
@@ -3,7 +3,7 @@
Date 今天晚上到圖書館
## 更新
-- 優化 `照相` 判斷邏輯
+
- 新增 `返回設定` 按鍵
@@ -23,9 +23,10 @@ Date
- 新增`語言包`功能(繁體中文, 英文)
- 修正`自動啟動`錯誤
- 調整`玩耍`歸位精細度
--
+- 優化 `照相` 判斷邏輯
+
## 支援
-- 遊戲版本:4.29.2
+- 遊戲版本:4.30.1
- 解析度:720x1280
- 語言:繁體中文、English
@@ -36,7 +37,7 @@ Date
- Increase `PLay` repositioning precision
## Support
-- Game version: 4.29.2
+- Game version: 4.30.1
- Resolution: 720x1280
- Language: Traditional chinese, English
@@ -86,4 +87,4 @@ Date
## 支援
- Cat and Soup 4.28.1
-- 解析度:720x1280
\ No newline at end of file
+- 解析度:720x1280
diff --git a/src/.ipynb_checkpoints/main-checkpoint.js b/src/.ipynb_checkpoints/main-checkpoint.js
index 5094f7a..7f11c9f 100644
--- a/src/.ipynb_checkpoints/main-checkpoint.js
+++ b/src/.ipynb_checkpoints/main-checkpoint.js
@@ -1,4 +1,4 @@
--/**
+/**
* 專案名稱: AutoCatAndSoup
* Copyright (C) 2026 Sthkm3
*
@@ -46,7 +46,7 @@ let config = {
// 浮窗權限檢查
function checkFloatyPermission() {
if (!Settings.canDrawOverlays(context)) {
- toast("perm_floaty");
+ toast(T('perm_floaty'));
var intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.setData(Uri.parse("package:" + context.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -60,7 +60,7 @@ function checkFloatyPermission() {
// 無障礙檢查
function checkAccessibility() {
if (!auto.service) {
- toast("perm_accessibility");
+ toast(T('perm_accessibility'));
app.startActivity({
action: Settings.ACTION_ACCESSIBILITY_SETTINGS
});
diff --git a/src/.ipynb_checkpoints/run-checkpoint.js b/src/.ipynb_checkpoints/run-checkpoint.js
index 292c589..f7eb8ab 100644
--- a/src/.ipynb_checkpoints/run-checkpoint.js
+++ b/src/.ipynb_checkpoints/run-checkpoint.js
@@ -48,15 +48,20 @@ let isPaused = false;
let win = floaty.rawWindow(
-
+
);
win.setPosition(0, (SCREEN_H / 2) - 80);
-win.setSize(160, -2); win.btnPause.click(() => { isPaused = !isPaused;
+win.setSize(160, -2);
-win.btnPause.setText(isPaused ? "{{T('start')}}" : "{{T('pause')}}");
-toast(isPaused ? "{{T('pause')}}" : "{{T('start')}}"); });
+win.btnPause.click(() => {
+ isPaused = !isPaused;
+ ui.run(() => {
+ win.btnPause.setText(isPaused ? T('start') : T('pause'));
+ });
+ toast(isPaused ? T('pause') : T('start'));
+});
// 主循環
while (true) {
@@ -69,13 +74,16 @@ while (true) {
// 判斷應用
if (currentPackage() != "com.hidea.cat" && !isPaused) {
+ home();
+ sleep(1000);
+
app.launchPackage("com.hidea.cat");
- toast("{{T('launchingʼ)}}");
+ toast(T('launching'));
var img = captureScreen();
var launch_time = 0;
- while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && launch_time <= 600) //啟動五分鐘無果 再次啟動
+ while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && launch_time <= 600){ //啟動五分鐘無果 再次啟動
launch_time += 1;
- sleep(1000);
+ sleep(5000);
var img = captureScreen();
}
continue;
@@ -120,7 +128,7 @@ while (true) {
// 拍照
if (config.Photo && !isPaused) {
- if (images.detectsColor(img, "#B5B5C6", 648, 813)){
+ if (images.detectsColor(img, "#B5B5C6", 648, 813) && images.detectsColor(img, "#FD7171", 682, 795)){
click(660, 815);
var img = captureScreen();
while(!images.detectsColor(img, "#FFFFFF", 360, 950)){
diff --git a/src/.ipynb_checkpoints/run2-checkpoint.js b/src/.ipynb_checkpoints/run2-checkpoint.js
deleted file mode 100644
index ddc4b7c..0000000
--- a/src/.ipynb_checkpoints/run2-checkpoint.js
+++ /dev/null
@@ -1,29 +0,0 @@
-while (true) {
-
-
-
-
-
-
- // --- 根據 Config 呼叫對應的 Task ---
- if (config.sellProduct) Tasks.sellProduct(img);
-
- if (config.upgradeFacility) Tasks.upgradeFacility(img);
-
- if (config.upgradeRecipe) Tasks.upgradeRecipe(img);
-
- if (config.Photo) Tasks.takePhoto(img);
-
- // 獎勵領取類
- if (config.receiveAFK || config.receiveJar || config.receiveMerchant) {
- Tasks.collectRewards(img);
- }
-
- if (config.receiveButterfly || config.receiveFrog) {
- Tasks.randomRewards(img);
- }
-
- // --- 結束本輪 ---
- img.recycle();
- sleep(200);
-}
diff --git a/src/main.js b/src/main.js
index 1dadb2f..7f11c9f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -46,7 +46,7 @@ let config = {
// 浮窗權限檢查
function checkFloatyPermission() {
if (!Settings.canDrawOverlays(context)) {
- toast("perm_floaty");
+ toast(T('perm_floaty'));
var intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.setData(Uri.parse("package:" + context.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -60,7 +60,7 @@ function checkFloatyPermission() {
// 無障礙檢查
function checkAccessibility() {
if (!auto.service) {
- toast("perm_accessibility");
+ toast(T('perm_accessibility'));
app.startActivity({
action: Settings.ACTION_ACCESSIBILITY_SETTINGS
});
diff --git a/src/run.js b/src/run.js
index 03db9ee..f7eb8ab 100644
--- a/src/run.js
+++ b/src/run.js
@@ -48,15 +48,20 @@ let isPaused = false;
let win = floaty.rawWindow(
-
+
);
win.setPosition(0, (SCREEN_H / 2) - 80);
-win.setSize(160, -2); win.btnPause.click(() => { isPaused = !isPaused;
+win.setSize(160, -2);
-win.btnPause.setText(isPaused ? "{{T('start')}}" : "{{T('pause')}}");
-toast(isPaused ? "{{T('pause')}}" : "{{T('start')}}"); });
+win.btnPause.click(() => {
+ isPaused = !isPaused;
+ ui.run(() => {
+ win.btnPause.setText(isPaused ? T('start') : T('pause'));
+ });
+ toast(isPaused ? T('pause') : T('start'));
+});
// 主循環
while (true) {
@@ -69,13 +74,16 @@ while (true) {
// 判斷應用
if (currentPackage() != "com.hidea.cat" && !isPaused) {
+ home();
+ sleep(1000);
+
app.launchPackage("com.hidea.cat");
- toast("{{T('launchingʼ)}}");
+ toast(T('launching'));
var img = captureScreen();
var launch_time = 0;
- while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && launch_time <= 600) //啟動五分鐘無果 再次啟動
+ while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && launch_time <= 600){ //啟動五分鐘無果 再次啟動
launch_time += 1;
- sleep(1000);
+ sleep(5000);
var img = captureScreen();
}
continue;
diff --git a/src/run2.js b/src/run2.js
deleted file mode 100644
index 3f1487c..0000000
--- a/src/run2.js
+++ /dev/null
@@ -1,23 +0,0 @@
-while (true) {
- // --- 根據 Config 呼叫對應的 Task ---
- if (config.sellProduct) Tasks.sellProduct(img);
-
- if (config.upgradeFacility) Tasks.upgradeFacility(img);
-
- if (config.upgradeRecipe) Tasks.upgradeRecipe(img);
-
- if (config.Photo) Tasks.takePhoto(img);
-
- // 獎勵領取類
- if (config.receiveAFK || config.receiveJar || config.receiveMerchant) {
- Tasks.collectRewards(img);
- }
-
- if (config.receiveButterfly || config.receiveFrog) {
- Tasks.randomRewards(img);
- }
-
- // --- 結束本輪 ---
- img.recycle();
- sleep(200);
-}