-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update 学习强国.js #174
base: version-14.2
Are you sure you want to change the base?
Update 学习强国.js #174
Conversation
.waitFor()当所需控件未出现的时候,会造成程序的阻滞。 应当尽量少用。
} | ||
}; | ||
if (endNow == 0) className('android.widget.RadioButton').depth(32).findOnce(optionIndex).click(); | ||
slp(1.8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slp(1.8)是啥意思呢,sleep()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我直接复制过来的,就是延时函数
*/ | ||
function waitForRadioButton(optionIndex) { | ||
var endNow = 0 | ||
while(!className('android.widget.RadioButton').depth(32).exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里貌似并没有解决控件因为某种原因没检测出来卡死的原因
如果检测不出来waitFor()会卡死,但你的while循环也退不出来啊
另外这里的depth()不能写死为32,因为挑战答题的是28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
挑战答题写成28就好了啊。
我写了以后就从来没有卡死过。
因为检测不到radioButton的情况就是答题结束或者控件未出现
应当尽量少用waitFor(),
当所需控件未出现的时候,程序会保持阻塞。
容易卡死。