执行prompt函数弹出对话框后,swipe滑动操作不起作用

//将下面这行修改为“var bird_select = 1”,能正常执行!
var bird_select = prompt("攻击几号目标?从左往右依次为1~8","");
if(bird_select!=null && bird_select!="" && bird_select in bird_arr){
console.log("您选择了"+bird_select+"号目标");
var select_x = bird_arr[bird_select][0];
var select_y = bird_arr[bird_select][1];
if(ra === null){
swipe(getScaleWidth(542), getScaleHeight(1274), getScaleWidth(select_x), getScaleHeight(select_y),random(250,550));
}else{
ra.swipe(getScaleWidth(542), getScaleHeight(1274), getScaleWidth(select_x), getScaleHeight(select_y),random(250,550));
}
}else{
alert("无效的选择目标!");
}

将弹出框放在另外一个线程里面也不行

var bird_select = threads.disposable();
	//启动子线程计算
	threads.start(function(){
	    var sel = rawInput("攻击几号目标?从左往右依次为1~8","");
	    //通知主线程接收结果
	    bird_select.setAndNotify(sel);
	});

	bird_select = bird_select.blockedGet();

swipe的执行结果是true

  • 3
    帖子
  • 182
    浏览

与 Auto.js 的连接断开,我们正在尝试重连,请耐心等待