当前位置:网站首页>Autojs, read one line, delete one line, and stop scripts other than your own
Autojs, read one line, delete one line, and stop scripts other than your own
2022-06-11 06:14:00 【Jiuli AJ】
New exchange group 917400262
Welcome to join v Group , Communicate with the great gods
disclaimer : The content of this blog is only for learning 、 Share and communicate , We do not guarantee the correctness of the content . By using the content of this blog, the following problems have nothing to do with this blog . When using this blog code , Represents that you have accepted the disclaimer of this blog
Body part
Catalog

Read a row and delete a row
function read_delete() {
// Delete first line
var path = "/sdcard/gjc.txt";//txt Text path
var reg = /^\s+|s+$/g; // Match invalid blank lines
var txt = files.read(path).replace(reg, "").split("\n");
let ret_text = txt[0];
log(ret_text.length);
if (txt != "") {
txt.splice(0, 1); // Delete
files.write(path, txt.join("\n"));
if (ret_text.length > 0) {
return ret_text.trim();
};
} else {
return " clothes "
};
file.close();
};
Two methods of traversal ( Get the current screen text )
console.show();
className("TextView").find().forEach(function(tv){
if(tv.text() != ""){
log(tv.text());
}
});
Method 2
console.show();
className("TextView").find().forEach(function(tv){
if(tv.text() != ""){
log(tv.text());
}
});
Node click function
function Click(node) {
// Jiuli super node click function ,qq1906507927. The problem of
try {
if (node) {
if (node.click()) {
return true
} else if (node.parent().click()) {
return true
} else if (node.parent().parent().click()) {
return true
} else if (node.parent().parent().parent().click()) {
return true
} else if (node.parent().parent().parent().parent().click()) {
return true
} else if (node.parent().parent().parent().parent().parent().click()) {
return true
} else if (node.parent().parent().parent().parent().parent().parent().click()) {
return true
}
}
} catch (e) { }
return false
}
Determine if the software has been installed
if (app.getPackageName("QQ")) {
log(" already installed ")
}else{
log(" Not installed ")
}
Stop all scripts except yourself
engines.all().map((ScriptEngine) => {
if (engines.myEngine().toString() !== ScriptEngine.toString()) {
ScriptEngine.forceStop();
}
});
Data read save delete
// Save local data
function setStorageData(name, key, value) {
const storage = storages.create(name);
storage.put(key, value);
};
// Read local data
function getStorageData(name, key) {
const storage = storages.create(name);
if (storage.contains(key)) {
return storage.get(key, "");
};
// Default return undefined
};
// Delete local data
function delStorageData(name, key) {
const storage = storages.create(name);
if (storage.contains(key)) {
storage.remove(key);
};
};
Get the contents of the clipboard
function Get the contents of the clipboard () {
let l = false
ui.run(() => {
var w = floaty.rawWindow(
'<vertical>\
< img src="@drawable/ic_description_black_48dp"h="20" />\
</vertical>'
);
w.setTouchable(false);
w.requestFocus();
let Timer = setInterval(() => {
if (l) {
log(" Shear board content :" + getClip())
w.close();
clearInterval( Timer );
}
}, 1)
})
let str = getClip()
l = true
return str
}
Practical replacement replace Code
var answer 2=" The answer is as follows ...."
var answer = answer 2.replace(" The answer is as follows ","");
// Replace the answer below with blank , Selected from actual combat projects , Data desensitization has been performed
Other small tip:
When used in a thread ui Function operation , Need to use ui.run, Otherwise, an error will be reported 4.1 The free version can be adapted to most machines without this , But the cloud machine does not support
Statement
This tutorial is only for learning , It is forbidden to use it for other purposes
QQ Group
917400262
边栏推荐
- Completabilefuture asynchronous task choreography usage and explanation
- Continuous update of ansible learning
- Chapter 1 of machine learning [series] linear regression model
- LeetCodeT526
- Eureka集群搭建
- Servlet
- "All in one" is a platform to solve all needs, and the era of operation and maintenance monitoring 3.0 has come
- Clojure installation of metabase source code secondary development
- Can Amazon, express, lazada and shrimp skin platforms use the 911+vm environment to carry out production number, maintenance number, supplement order and other operations?
- [daily exercises] 1 Sum of two numbers
猜你喜欢

Warmly celebrate that yeyanxiu, senior consultant of Longzhi, won the title of "atlassian Certified Expert"

Summarize the five most common BlockingQueue features

Implementation of data access platform scheme (Youzu network)
![[reading this article is enough!!! Easy to understand] confidence level understanding (95% confidence level and confidence interval)](/img/d6/e61ba5bad2b2847378c4547ce0780d.jpg)
[reading this article is enough!!! Easy to understand] confidence level understanding (95% confidence level and confidence interval)
![Chapter 1 of machine learning [series] linear regression model](/img/e2/1f092d409cb57130125b0d59c8fd27.jpg)
Chapter 1 of machine learning [series] linear regression model

做亚马逊测评要了解的知识点有哪些?

This point of arrow function

Review Servlet

Review XML and JSON

FPGA设计——乒乓操作实现与modelsim仿真
随机推荐
Shandong University machine learning experiment 7 pca+ SVM face recognition
Notes sur les questions d'entrevue de la FPGA (IV) - - détecteur de séquence, Code gris dans le domaine de l'horloge croisée, opération de ping - pong, réduction de la perte statique et dynamique, err
CCF 2013 12-4 interesting numbers
NLP-D46-nlp比赛D15
FIFO最小深度计算的题目合集
A collection of problems on improving working frequency and reducing power consumption in FPGA design
Review XML and JSON
Transfer Learning
C语言大战“扫雷”
通过R语言且只用基础package来制作一个小游戏
Excellent practice | how to avoid a bloody case caused by a line of wrong code?
Analyze the capacity expansion mechanism of ArrayList
Simple understanding of pseudo elements before and after
学好C语言从关键字开始
Verilog realizes binocular camera image data acquisition and Modelsim simulation, and finally matlab performs image display
Can Amazon, express, lazada and shrimp skin platforms use the 911+vm environment to carry out production number, maintenance number, supplement order and other operations?
FPGA设计——乒乓操作实现与modelsim仿真
Don't be afraid of xxE vulnerabilities: understand their ferocity and detection methods
[daily exercises] 1 Sum of two numbers
Sqoop installation tutorial