//天天爱消除经典模式自动
requestScreenCapture();
ab8 = 5;//误差
openConsole();
function capturescreen() {
while (true) {
if (ab = captureScreen()) {
return ab;
break;
}
}
}
function ab0(ab1, ab2, ab3, ab4) {
if(ab3>6||ab3<0||ab4>6||ab4<0){
return false;
}
ab5 = capturescreen();
ab6 = images.pixel(ab5, b0[ab1], b1[ab2]);
ab7 = images.pixel(ab5, b0[ab3], b1[ab4]);
if (Math.abs(colors.red(ab6) - colors.red(ab7)) < ab8 && Math.abs(colors.green(ab6) - colors.green(ab7)) < ab8 && Math.abs(colors.blue(ab6) - colors.blue(ab7)) < ab8) {
return true;
} else {
return false;
}
}
function b11(aa1,aa2,aa3,aa4){
log(aa1+","+aa2+"移到"+aa3+","+aa4);
swipe(b0[aa1],b1[aa2],b0[aa3],b1[aa4],100);
}
main();
function main(){
b0=[87,239,391,544,696,848,1001];
b1=[575,727,879,1030,1182,1334,1485];
b5=[1,2,1,2,3,1,2];
b6=[-1,-1,0,0,0,1,1];//右边是初始化坐标
b7=[-1,-2,-1,-2,-3,-1,-2];
while(true){
for(b3=0;b3<=6;b3++){
for(b4=0;b4<=6;b4++){
for(b8=0;b8<=3;b8++){
if(b8==0){b9=b5;b10=b6;};//左
if(b8==1){b9=b6;b10=b5;};//下
if(b8==2){b9=b7;b10=b6;};//右
if(b8==3){b9=b6;b10=b7;};//上
if(ab0(b3,b4,b3+b9[2],b4+b10[2])){
//相邻一样
if(ab0(b3,b4,b3+b9[1],b4+b10[1])){
//邪上一样
b11(b3+b9[1],b4+b10[1],b3+b9[3],b4+b10[3]);
}
if(ab0(b3,b4,b3+b9[4],b4+b10[4])){
//相相邻一样
b11(b3+b9[4],b4+b10[4],b3+b9[3],b4+b10[3]);
}
if(ab0(b3,b4,b3+b9[6],b4+b10[6])){
//邪下一样
b11(b3+b9[6],b4+b10[6],b3+b9[3],b4+b10[3]);
}
}
if(ab0(b3,b4,b3+b9[3],b4+b10[3])){
//相隔一样
if(ab0(b3,b4,b3+b9[0],b4+b10[0])){
//中上一样
b11(b3+b9[0],b4+b10[0],b3+b9[2],b4+b10[2]);
}
if(ab0(b3,b4,b3+b9[5],b4+b10[5])){
//中下一样
b11(b3+b9[5],b4+b10[5],b3+b9[2],b4+b10[2]);
}
}
}
}
}
}
}