You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorial/intro.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,39 +2,39 @@
2
2
sidebar_position: 1
3
3
---
4
4
5
-
# Intro
5
+
# 简介
6
6
7
7

8
8
9
-
XXTouch Elite is a powerful and flexible tool that allows you to create custom automation scripts for your devices. With XXTouch Elite, you can automate repetitive tasks, control smart home devices, and much more.
XXTouch Elite uses[Lua](https://www.lua.org/) (v5.3) as its scripting language, which is a lightweight and **easy-to-learn** programming language. Lua is known for its simplicity and flexibility, making it an ideal choice for automation tasks.
This documentation will guide you through the process of getting started with XXTouch Elite, including installation, configuration, and writing your first script. Whether you’re a beginner or an experienced programmer, you’ll find everything you need to know to start automating your devices with XXTouch Elite.
- XXTouch Elite is designed to work on iPhone/iPad with iOS 14 and later.
18
-
-You need to [jailbreak your device](https://ios.cfw.guide/types-of-jailbreak/)to use XXTouch Elite. Following jailbreak methods are supported and tested:
Ask for help on our [GitHub repository](https://github.com/OwnGoalStudio/XXTouchElite/issues)or join our [Discord server](https://discord.gg/RTyMX6c9). We are happy to help you with any issues you may encounter while using XXTouch Elite.
Copy file name to clipboardExpand all lines: i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorial/make-some-notes.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,48 +2,48 @@
2
2
sidebar_position: 5
3
3
---
4
4
5
-
# Make Some Notes
5
+
# 做一些笔记
6
6
7
-
Now we are ready to start developing scripts. You can use the web interface to create and edit scripts, as well as test them in real-time.
7
+
现在我们已经准备好开始开发脚本了。你可以使用网页界面来创建和编辑脚本,并实时测试它们。
8
8
9
-
In this tutorial, we will create a simple script that opens “Notes” on your device, creates a new note, and writes the most famous sentence in the developer community: `Hello, World!`.
Let’s start by creating a new script. Click on the “New Script” button on the top-right corner of the page. Enter a name for your script, e.g. `my-awesome-script.lua`.
The first thing we need to do is to open the “Notes” app. To do this, we will use the [`app.run`](../lua-manual/app.md#run-the-app-apprun)function. The [`app.run`](../lua-manual/app.md#run-the-app-apprun)function takes a string as an argument, which is the bundle identifier of the app we want to open. In our case, we want to open the “Notes” app, so we will use the string `"com.apple.mobilenotes"`.
Note that the [`nLog`](../lua-manual/appendix/logging-facilities.md#nlog)function is used to log messages to the console. This is useful for debugging and testing your scripts.
Click “Play” button at the bottom-right corner of the page to run the script. You should see the “Notes” app open on your device.
28
+
点击页面右下角的 “播放” 按钮运行脚本。你应该会看到 “备忘录” 应用在你的设备上打开。
29
29
30
30

31
31
32
32
:::info
33
-
Find the bundle identifier of an app from “More” → “Application List” in “X.X.T.E.” app.
33
+
在 “X.X.T.E.” 应用中,从 “更多” → “应用列表” 中找到应用的包标识符。
34
34
:::
35
35
36
-
## Find “New Note” Button
36
+
## 找到 “新建笔记” 按钮
37
37
38
-
Now that we have opened the “Notes” app, we need to find the “New Note” button. To do this, we will use the [`screen.find_color`](../lua-manual/screen.md#-multi-point-similarity-mode-color-finding-screenfind_color)function. The [`screen.find_color`](../lua-manual/screen.md#-multi-point-similarity-mode-color-finding-screenfind_color)function takes a color table as an argument, which is the collection of the color samples we want to find.
Open “Color Picker” in the sidebar, locate the “New Note” button, and click on it. This will add the color sample to the color table. You have to add more color samples to increase the possibility of finding the button.
Copy generated code from `find_color`function and paste it into your script:
46
+
从 `find_color`函数中复制生成的代码并粘贴到你的脚本中:
47
47
48
48
```lua
49
49
localx, y
@@ -66,37 +66,37 @@ touch.tap(x, y)
66
66
sys.sleep(2)
67
67
```
68
68
69
-
Here we’ve added 6 color samples to the color table. Use `while ... do`loop to keep searching for the button until it is found. The [`sys.sleep(1)`](../lua-manual/sys.md#-second-level-delay-syssleep)function is used to pause the script for 1 second before searching again.
The [`screen.find_color`](../lua-manual/screen.md#-multi-point-similarity-mode-color-finding-screenfind_color)function returns the coordinates of the button if it is found, or `nil` if it is not found. We will use these coordinates with [`touch.tap`](../lua-manual/touch.md#simulate-a-single-tap-on-the-screen-touchtap)to click on the button.
Making color samples is not an easy task. Here are some practical tips:
74
+
制作颜色样本并不容易。以下是一些实用技巧:
75
75
76
-
1.**Select different colors**. Different colors make the search more unique.
77
-
2.**Avoid graph edges**. Due to the anti-aliasing effect, the colors on the edges vary a lot.
78
-
3.**Stay spread out**. The sampled points should be spread out to cover more space in the area that you want to locate.
76
+
1.**选择不同的颜色**。不同的颜色使搜索更具唯一性。
77
+
2.**避免图形边缘**。由于抗锯齿效果,边缘上的颜色变化很大。
78
+
3.**保持分散**。采样点应分散开来,以覆盖你想要定位的区域中的更多空间。
79
79
80
80
:::
81
81
82
-
## Enter “Hello, World!”
82
+
## 输入 “Hello, World!”
83
83
84
-
Sending text to the “Notes” app is the most straightforward part. We can use the [`key.send_text`](../lua-manual/key.md#simulate-typing-text-keysend_text)function to send text to the app. The [`key.send_text`](../lua-manual/key.md#simulate-typing-text-keysend_text)function takes a string as an argument, which is the text we want to send.
Click “Play” button at the bottom-right corner of the page to run the script.
91
+
点击页面右下角的 “播放” 按钮运行脚本。
92
92
93
93

94
94
95
-
## Tap “Done”
95
+
## 点击 “完成”
96
96
97
-
Finally, we need to tap the “Done” button to save the note. We can use the [`screen.ocr_text`](../lua-manual/screen.md#-screen-optical-character-recognition-screenocr_text)function to find the “Done” button and then use [`touch.tap`](../lua-manual/touch.md#simulate-a-single-tap-on-the-screen-touchtap)to click on it. This part is a bit tricky because texts are easily affected by the font and size, so we need to use OCR (Optical Character Recognition) to find it.
Copy file name to clipboardExpand all lines: i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorial/run-custom-script.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
sidebar_position: 3
3
3
---
4
4
5
-
# Run Custom Script
5
+
# 运行自定义脚本
6
6
7
-
Playing recorded scripts is great, but it is unlikely to respond to all the possible situations that can occur in a real-world scenario. For this reason, it is important to create a script that can handle different situations.
Now we’ve written a script for you that will help you get started. This script will open the “Settings”, scroll down to find “App Store” option, and click on it.
0 commit comments