autojs之乐旅商城自动报名自动约

之前用的。现在能不能用不知道了啊。自己测试吧。

//一键亮屏
device.wakeUp();
device.wakeUpIfNeeded(); sleep(1000);

//滑开
swipe( device.width/2, device.height*0.8, device.width/2, device.height*0.1, 2000);
sleep(2000);


//一键开微信
launchApp("微信");
sleep(5000);

//到首页
tt = text("微信").findOne(3000);
if( tt ){ click( tt.bounds().centerX(), tt.bounds().centerY() );  }


//进-乐旅商城
swipe( device.width/2, device.height*0.1,device.width/2, device.height*0.8,  2000);
sleep(3000);
tt = text("乐旅商城").findOne(3000);
if( tt ){ click( tt.bounds().centerX(), tt.bounds().centerY() ); }

//点-预约报名,歇十秒
a=textContains("-").find();
a=a[1];
click( a.bounds().centerX(), a.bounds().centerY() );
sleep(10*1000);

//自动约酒店--乐旅商城
aa = text("预约申购").findOne(2000);
if( aa ){
	console.show();
	tm = new Date();
	t1 = 10;
	t2 = 0;
	t3 = 0;
	checkTime = function( tm1,tm3,tm3 ){
		tm = new Date();
		if( tm.getHours()>=t1 && tm.getMinutes()>=t2 && tm.getSeconds()>=t3 ) return true;
		return false;
	}
	while( !checkTime() ){
		tm = new Date();
		console.log( tm.getHours()+":"+tm.getMinutes()+":"+tm.getSeconds() );
		sleep(300);
	}
	console.clear();
	console.log("开始点击");
	t = text("预约报名").findOne(2200);
	if( t ){
		while( true ){
			ok1 = text("确认").findOne(300); 
			if( ok1 ){ 
				click( ok1.bounds().centerX(), ok1.bounds().centerY() ); sleep(200);
				click( ok1.bounds().centerX(), ok1.bounds().centerY() ); 
				continue;
			}
			ok1 = text("预约报名").findOne(300);
			if( ok1 ){ 
				click( ok1.bounds().centerX(), ok1.bounds().centerY() ); sleep(200);
				click( ok1.bounds().centerX(), ok1.bounds().centerY() ); 
				continue;
			}
			ok1 = text("我知道了").findOne(300); if( ok1 ){ device.vibrate(1000); break; }
			ok1 = text("已报名").findOne(300);   if( ok1 ){ device.vibrate(1000); break; }
		}
	}else{
		alert("未找到元素1,请抓紧手工进行!")
	}
	console.hide();
}else{
	alert("未找到元素2,请抓紧手工进行!")
}

还没有autojsPro 的。可以在这下载

2025最新auto.js Pro 9.3.1.1免登录 不需root能打包app,亲测可用,非常简单https://mp.weixin.qq.com/s/LZVb0KMakt7rEt1aLZeZcg?token=1785509862&lang=zh_CN

你可能感兴趣的:(javascript,前端,开发语言,autojs,安卓脚本)