刪除run2 修復拍照活動偵測錯誤

This commit is contained in:
Sahik committed 2026-04-06 04:20:02 +08:00
1 parent 0b5925520e
commit cc23f0888c
7 files changed
+42 -77

No files matched your search

+6 -5
View File
@@ -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
- 解析度:720x1280
+3 -3
View File
@@ -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
});
+16 -8
View File
@@ -48,15 +48,20 @@ let isPaused = false;
let win = floaty.rawWindow(
<vertical bg="#AA000000" padding="6">
<text text="Auto CatAndSoup" textColor="#FFFFFF" textSize="12sp"/>
<button id="btnPause" text="pause"/>
<button id="btnPause" text="{{T('pause')}}"/>
</vertical>
);
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)){
-29
View File
@@ -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);
}
+2 -2
View File
@@ -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
});
+15 -7
View File
@@ -48,15 +48,20 @@ let isPaused = false;
let win = floaty.rawWindow(
<vertical bg="#AA000000" padding="6">
<text text="Auto CatAndSoup" textColor="#FFFFFF" textSize="12sp"/>
<button id="btnPause" text="pause"/>
<button id="btnPause" text="{{T('pause')}}"/>
</vertical>
);
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;
-23
View File
@@ -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);
}