这几天,双十一的活动有没有把你折腾的不轻呢?如果没有,只有两种可能:一,你没女朋友;二,你没有女性朋友,不然你一定会收到如下消息:
要知道阿里每年都会发放大量红包、各种优惠券和各种互助游戏…而这两天,马爸爸的“ATM”们可都沉迷于这些个互助游戏里不可自拔,吾日三省吾身:签到了?做任务了么?升级了么?:
一般我们程序员对这种游戏都是没什么太大兴趣,毕竟每天都有找不完的Bug,加不完的班,但是假如在这时候你的女神向你求帮助的时候,就你那个等级你拿的出手么?
所以,程序员怎么能错过这么一个在女神面前展现专业能力的时候呢,这不,今天猿妹就在GitHub上发现,有程序员写了一个小脚本,可以每天自动做任务,领喵币,这下帮女神盖楼,再也不用担心等级低了:
可以看出来目前这个小脚本还没有引起程序员的注意,一个星星都还没获得(GitHub地址:https://github.com/sleepybear1113/taobaoVisitingVenues)
其实,这个脚本并不难,基于auto.js框架来实现,auto.js是一个支持无障碍服务的Android平台上的JavaScript IDE,以控件为基础,能自动运行一些操作,实现悬浮窗录制和运行。所以这个脚本只支持安卓系统。
详细的脚本代码如下:
```python
let deviceWidth = device.width;
let deviceHeight = device.height;
function openBeginningBtnItem(delay) {
let items = textStartsWith("gif;base64").depth(19).find();
console.log("寻找--领喵币");
if (items.length > 0) {
let item = items[items.length - 1];
console.log("点击--领喵币");
clickItemInCenter(item);
sleep(delay);
return 1;
}
return -1;
}
function isOpenBeginning() {
let signIn = textContains("签到").findOnce();
if (signIn != null) {
console.log("成功--打开领取中心");
return 1;
}
return -1;
}
function ensureOpenBeginning(waitDelay) {
if (isOpenBeginning() === -1) {
openBeginningBtnItem(waitDelay);
}
if (isOpenBeginning() === 1) return 1;
console.error("失败--打开领取中心");
toast("失败--打开领取中心");
return -1;
}
function clickItemInCenter(item, time) {
if (time == null) time = 50;
if (item == null) return;
let x = item.bounds().centerX();
let y = item.bounds().centerY();
press(x, y, time);
}
function goShopping() {
let shopping = text("去浏览").findOne(1000);
if (shopping == null) {
toastLog("结束--未知问题");
return -1;
}
console.log("开始浏览...");
clickItemInCenter(shopping);
return 1;
}
function swipeUp() {
let x = parseInt(deviceWidth / 2);
let duration = 500;
let y = [parseInt(deviceHeight * 0.75), parseInt(deviceHeight * 0.25)];
swipe(x, y[0], x, y[1], duration);
swipe(x, y[0], x, y