}
    if(board_x_sum){
        board_x = board_x_sum / board_x_c
    }
}
// 按实际的角度30度来算,找到接近下一个 board 中心的y坐标 :y=x*tan(30)
var board_y = piece.y - abs(board_x - piece.x) * Math.sqrt(3) / 3;

if(!(board_x && board_y)){
    return null;
}
return {
    x: board_x, y: board_y
}

}

function prepare(){

//确保无障碍服务开启
auto();
//请求截图权限
requestScreenCapture();
device.keepScreenOn(1000 * 3600);

if(device.sdkInt < 24){
    root_automator = new RootAutomator();
}

}
events.on("exit", function(){
device.cancelKeepingAwake();
if(root_automator){
root_automator.exit();
}
});