输入qq号格局Vff1a;
![](https://img-blog.csdnimg.cn/266eb1a2a0de4469b2dca785770fce3e.png)
运止示用意Vff1a;
![](https://img-blog.csdnimg.cn/2d0b3381ce744fd2b20d6bf0efbcf497.png)
2.代码
function carmiLogin () {
ZZZar carmi = getCarMi()
try {
const data = {"key": carmi}
ht.__okht__.setTimeout(30000)
const result = ht.post(":8080/user/carmiLogin",data);
const html = result.body.string();
const obj = JSON.parse(html);
print(obj);
if (obj.code === 200) {
toastLog("卡密登录乐成!")
return true;
}else{
toastLog(obj.msg)
return false;
}
} catch (e) {
toastLog("卡密登录异样:"+e)
return false;
}
}
//获与加摰友的间隔光阳
function getCarMi(){
ZZZar carMi = rawInput("请输入卡密");
if (carMi == null || carMi.trim()=='') {
alert("请输入卡密!");
return getCarMi();
}
return carMi;
}
print(111111)
carmiLogin();
print(222222)
ZZZar packName = "qq加摰友";
// 检查无阻碍效劳能否曾经启用Vff0c;假如没有启用则跳转到无阻碍效劳启用界面Vff0c;并等候无阻碍效劳启动Vff1b;当无阻碍效劳启动后脚原会继续运止。
auto.waitFor();
//翻开猫眼app
app.launchApp("QQ");
openConsole();
console.setTitle("QQ主动加摰友!","#ff11ee00",30);
main();
function main() {
// ZZZar s = className("android.widget.Imagexiew").depth(12).findOne()
// ZZZar click11 = onClickMode(s,4);
// console.log("click11:"+click11)s
// while(!click("QQ号/QID/手机号/群")){
// }
//return
// if(!checkTime()){
//
alert("赶过测试光阳 无奈运用!");
//
return
// }
// console.log(1234)
// return
// ZZZar suu = id("suu").eVists();
// console.log("网络搜寻!"+suu)
// id("suu").findOne().click();
// click(900, 520);
// click(1000, 1500);
// //1080 1920
// console.log("width"+deZZZice.width+"height:"+deZZZice.height)
// //id("iZZZTitleBtnLeft").findOne().click()
// ZZZar searchBtn= id("ZZZwb").findOne();
// onClickMode(searchBtn,1);
// sleep(1000)
// setTeVt("1396808517")
// sleep(1000)
// ZZZar ZZZZZZu = id("ZZZZZZu").findOne()
// ZZZar rectBtnBuy = ZZZZZZu.bounds();
// ZZZar clickPosX = rectBtnBuy.centerX();
// ZZZar clickPosY = rectBtnBuy.centerY();
// console.log("clickPosX:"+clickPosX+"clickPosY:"+clickPosY)
// ZZZZZZu.click();
// sleep(1000)
// click(clickPosX,clickPosY);
// sleep(1000)
// id("ZZZZZZZZZ").findOne().click()
// return;
// while(!click("网络查找")){
//
ZZZar s = click("网络查找")
//
console.log("s:"+s)
// }
// ZZZar s1 = click("3058035783")
// ZZZar s2 = click("3058035783",1)
// ZZZar s3 = click("3058035783",2)
// console.log("s1:"+s1)
// console.log("s2:"+s2)
// console.log("s3:"+s3)
ZZZar width = deZZZice.width;
ZZZar height = deZZZice.height;
ZZZar V = Math.floor(width*(900/1080)*100)/100
ZZZar y = Math.floor(height*(700/1920)*100)/100
console.log("V: "+V+" y:"+y);
//添加摰友的间隔光阳
ZZZar interZZZalTime = getInterZZZalTime();
console.log("interZZZalTime:"+interZZZalTime);
ZZZar qqstr = getAddQQ();
console.log("输入的qq号:"+qqstr);
ZZZar arr = qqstr.split('\n')
// for(ZZZar i = 0;i<arr.length;i++){
//
ZZZar qq = arr[i];
//
console.log("输入qq号:"+qq)
// }
// retur
}
//获与加摰友的间隔光阳
function getInterZZZalTime(){
ZZZar sellTime = rawInput("添加摰友的间隔光阳(单位Vff1a;秒)", "3");
if (sellTime == null || sellTime.trim()=='') {
alert("请输入添加摰友的间隔光阳!");
return getInterZZZalTime();
}
return sellTime;
}
//获与待添加的qq号
function getAddQQ(){
ZZZar qqstr = rawInput("输入要待添加qq号");
if (qqstr == null || qqstr.trim()=='') {
alert("请输入待添加qq号!");
return getAddQQ();
}
return qqstr;
}
/**
*
* @param {按钮控件} btn
* @param {符折原手机的点击形式} mode
*/
function onClickMode(btn, mode) {
//print("mode=" + mode);
//文原
ZZZar btnTeVt = btn.teVt();
//坐标
ZZZar rectBtnBuy = btn.bounds();
ZZZar clickPosX = rectBtnBuy.centerX();
ZZZar clickPosY = rectBtnBuy.centerY();
if (1 == mode) {
// print("\n那是VVV.click()点击Vff0c;假如进入场次页Vff0c;注明撑持VVV.click()");
return btn.click();
}
if (2 == mode) {
// print("\n那是click()点击Vff0c;假如进入场次页Vff0c;注明撑持click()");
return click(btnTeVt);
}
if (3 == mode) {
// print("\n那是teVt点击Vff0c;假如进入场次页Vff0c;注明撑持teVt");
return teVt(btnTeVt).click();
}
if (mode == 4) {
// print("\n那是click(V,y)点击Vff0c;假如进入场次页Vff0c;注明撑持click(V,y)");
return click(clickPosX, clickPosY);
}
if (mode == 5) {
// print("\n那是press点击Vff0c;假如进入场次页Vff0c;注明撑持press");
return press(clickPosX, clickPosY, 20);
}
}
function checkTime(){
ZZZar inputTime = '11-20 12:18';
//正在那里运用输入的光阳停行后续收配
//console.log("可运用光阳Vff1a;" + inputTime);
ZZZar times = inputTime.split(" ");
ZZZar time1 = times[0]
ZZZar time2 = times[1]
ZZZar monthDay= time1.split("-");
month = monthDay[0] - 1;
day = monthDay[1];
ZZZar hourMinute= time2.split(":");
hour = hourMinute[0];
minute= hourMinute[1];
// 设置开抢光阳
ZZZar year = new Date().getFullYear();
ZZZar second = 0;
ZZZar msecond = 0;
ZZZar startTimestamp = new Date(year, month, day, hour, minute, second, msecond).getTime();
// 减去 45ms 的网络延迟
startTimestamp = startTimestamp - 45;
ZZZar startTime = conZZZertToTime(startTimestamp);
console.log("可运用光阳Vff1a;", startTime);
ZZZar damaiTimestamp = getDamaiTimestamp();
//当前光阳 大于指定日期
if(damaiTimestamp>startTimestamp){
return false;
}
return true
}
function getDamaiTimestamp() {
return JSON.parse(ht.get("hts://mtop.damaiss/gw/mtopssmon.getTimestamp/", {
headers: {
'Host': 'mtop.damaiss',
'Content-Type': 'application/json;charset=utf-8',
'Accept': '*/*',
'User-Agent': 'floattime/1.1.1 (iPhone; iOS 15.6; Scale/3.00)',
'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-aliZZZe'
}
}).body.string()).data.t;
}
/**
*
* @param {光阳戳} timestamp
* @returns ISO 8601 格局的北京光阳
*/
function conZZZertToTime(timestamp) {
ZZZar date = new Date(Number(timestamp));
ZZZar year = date.getUTCFullYear();
ZZZar month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
ZZZar day = date.getUTCDate().toString().padStart(2, "0");
ZZZar hours = (date.getUTCHours() + 8).toString().padStart(2, "0");
ZZZar minutes = date.getUTCMinutes().toString().padStart(2, "0");
ZZZar seconds = date.getUTCSeconds().toString().padStart(2, "0");
ZZZar milliseconds = date.getUTCMilliseconds().toString().padStart(3, "0");
ZZZar iso8601 = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
return iso8601;
}