本帖最後由 歐菲爾 於 2014-10-5 21:21 編輯
- -- 腳本描述
- DESCRIPTION="自動餵魚";
- -- 適用屏幕參數
- SCREEN_RESOLUTION="800x1280";
- SCREEN_COLOR_BITS=32;
- -- 主入口
- function main()
- function click(x, y)
- touchDown(0, x+5, y+5);
- touchUp(0);
- end
- function start()
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/魚食.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("第一次搜尋!餵魚!");
- click(x, y)
- return aa()
- else
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/魚食.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("第二次搜尋!餵魚!");
- click(x, y)
- return aa()
- else
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/魚食.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("第三次搜尋!餵魚!");
- click(x, y)
- return aa()
- else
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/max.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("魚長大了。");
- return bb()
- else
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/x.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("已返回繼續餵魚。");
- click(x, y)
- mSleep(5000);
- return start()
- end
- end
- end
- end
- end
- function aa()
- mSleep(2000);
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/普通食物.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("餵魚成功!");
- click(x, y)
- mSleep(5000);
- return start()
- end
- function bb()
- mSleep(2000);
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/出售1.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("要賣了。");
- click(x, y)
- mSleep(2000);
- x, y = findImageFuzzy("/mnt/sdcard/Touchelper/plugins/出售2.bmp",80);
- if x ~= -1 and y ~= -1 then
- notifyMessage("賣出了!");
- click(x, y)
- mSleep(3000);
- return main()
- end
- end
複製代碼
把74行移動到77行看看 |