v1.1.0-2
This commit is contained in:
1 parent
c405210b4a
commit
b4a8f62f29
1 file changed
+9
-6
+9
-6
@@ -1,4 +1,4 @@
|
|||||||
-/**
|
/**
|
||||||
* 專案名稱: AutoCatAndSoup
|
* 專案名稱: AutoCatAndSoup
|
||||||
* Copyright (C) 2026 Sthkm3
|
* Copyright (C) 2026 Sthkm3
|
||||||
*
|
*
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
const STORAGE = storages.create("AutoCatAndSoupConfig");
|
const STORAGE = storages.create("AutoCatAndSoupConfig");
|
||||||
|
|
||||||
|
// 語言包
|
||||||
|
const T = require("./i18n.js");
|
||||||
|
|
||||||
const SCREEN_W = 720;
|
const SCREEN_W = 720;
|
||||||
const SCREEN_H = 1280;
|
const SCREEN_H = 1280;
|
||||||
|
|
||||||
@@ -46,15 +49,15 @@ let isPaused = false;
|
|||||||
let win = floaty.rawWindow(
|
let win = floaty.rawWindow(
|
||||||
<vertical bg="#AA000000" padding="6">
|
<vertical bg="#AA000000" padding="6">
|
||||||
<text text="Auto CatAndSoup" textColor="#FFFFFF" textSize="12sp"/>
|
<text text="Auto CatAndSoup" textColor="#FFFFFF" textSize="12sp"/>
|
||||||
<button id="btnPause" text="暫停"/>
|
<button id="btnPause" text="pause"/>
|
||||||
</vertical>
|
</vertical>
|
||||||
);
|
);
|
||||||
|
|
||||||
win.setPosition(0, (SCREEN_H / 2) - 80);
|
win.setPosition(0, (SCREEN_H / 2) - 80);
|
||||||
win.setSize(160, -2); win.btnPause.click(() => { isPaused = !isPaused;
|
win.setSize(160, -2); win.btnPause.click(() => { isPaused = !isPaused;
|
||||||
|
|
||||||
win.btnPause.setText(isPaused ? "啟動" : "暫停");
|
win.btnPause.setText(isPaused ? "{{T('start')}}" : "{{T('pause')}}");
|
||||||
toast(isPaused ? "已暫停" : "已啟動"); });
|
toast(isPaused ? "{{T('pause')}}" : "{{T('start')}}"); });
|
||||||
|
|
||||||
// 主循環
|
// 主循環
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -64,10 +67,10 @@ while (true) {
|
|||||||
// 判斷應用
|
// 判斷應用
|
||||||
if (pkg != "com.hidea.cat" && !isPaused) {
|
if (pkg != "com.hidea.cat" && !isPaused) {
|
||||||
app.launchPackage("com.hidea.cat");
|
app.launchPackage("com.hidea.cat");
|
||||||
toast("嘗試開啟遊戲...");
|
toast("launching_game");
|
||||||
var img = captureScreen();
|
var img = captureScreen();
|
||||||
while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && pkg == "com.hidea.cat"){
|
while(!images.detectsColor(img, "#F4ECD3", 685, 1095) && pkg == "com.hidea.cat"){
|
||||||
sleep(5000);
|
sleep(1000);
|
||||||
var pkg = currentPackage();
|
var pkg = currentPackage();
|
||||||
var img = captureScreen();
|
var img = captureScreen();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user