app.launchPackage("com.netease.cloudmusic")
id("a68").findOne().click();
text("1.That Girl - Olly Murs").findOne().parent().click();
waitForActivity("com.netease.cloudmusic.activity.PlayListActivity", [period = 200])
text("播放全部").waitFor(); //等待控件出现
while (1) {
desc("转到上一层级").waitFor();
var p = id("a").find();
var q = p.size();
sleep(1000);
for (i = 0; i < q; i++) {
p.get(i).click();
sleep(500)
textStartsWith("评论").findOne(). parent().click();
//bounds(0, 1294, 1080, 1415).findOne().click();
var a = http.get("http://word.rainss.cn/api_system.php?type=txt").body.string();
sleep(2000);
id("jc").findOne().click();
sleep(500);
setText(a);
sleep(500);
while (!click("发送"));
sleep(1000);
desc("转到上一层级").findOne().click();
sleep(1000);
}
id("adm"). findOne().scrollForward();
sleep(1000);
}