Android 台灣中文網

標題: [觸摸精靈] 懇求高手相助 [打印本頁]

作者: braxus    時間: 2014-8-4 07:45
標題: [觸摸精靈] 懇求高手相助
我想要在下列座標上顏色等於後面的時候
點擊該座標位置

310,86,        0x73451A
420,290,        0xBCB69C
175,86,        0x813C00
384,95,        0x470E11
567,71,        0x7C7011
443,313,        0x464B0A
450,470,        0x070D16

並且要一直循環
懇求大神們幫忙
作者: 賈克爆炸    時間: 2014-8-4 10:45
自己爬文自己看教學!
作者: zhuzigogogo    時間: 2014-8-4 10:53
提示: 作者被禁止或刪除 內容自動屏蔽
作者: braxus    時間: 2014-8-4 12:17
不是沒爬文不是沒研究

SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function dz(x1,y1,a)         --找色點擊判斷函數
         xx = getColor(x1, y1);
                if xx==a then
                touchDown(0, x1, y1);
                touchUp(0);
                end
        mSleep(80);
end

function main()
        while true do
        dz(310,86,0x73451A);--一般走路
        mSleep(80);
        end;
        while true do
        dz(420,290,0xBDB69D);--獲得卡片
        mSleep(80);
        end;
        while true do
        dz(175,86,0x813C00);--戰鬥
        mSleep(80);
        end;
        while true do
        dz(384,95,0x470E11);--略過
        mSleep(80);
        end;
        while true do
        dz(567,71,0x7C7011);--黃勾確定
        mSleep(80);
        end;
        while true do
        dz(443,313,0x464B0A);--取消
        mSleep(80);
        end;
        while true do
        dz(450,470,0x070D16);--使用黃藍
        mSleep(80);
        end;
end
作者: braxus    時間: 2014-8-4 12:18
不是沒爬文 不是沒研究

SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function main()

         xx = getColor(310,86);
                if xx=="0x73451A" then
                touchDown(0, 310,86);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(420,290);
                if xx=="0xBDB69D" then
                touchDown(0, 420,290);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(175,86);
                if xx=="0x813C00" then
                touchDown(0, 175,86);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(384,95);
                if xx=="0x470E11" then
                touchDown(0, 384,95);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(567,71);
                if xx=="0x7C7011" then
                touchDown(0, 567,71);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(443,313);
                if xx=="0x464B0A" then
                touchDown(0, 443,313);
                touchUp(0);
                end
        mSleep(80);

         xx = getColor(450,470);
                if xx=="0x070D16" then
                touchDown(0, 450,470);
                touchUp(0);
                end
        mSleep(80);

end

作者: braxus    時間: 2014-8-4 12:18
不是沒爬文
不是沒研究

SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function main()

             if getColor(310,86) == 0x73451A then
                mSleep(200);
                touchDown(1, 310,86)
                mSleep(50);
                touchUp(1)
             else
                mSleep(250);
             end

             if getColor(420,290) == 0xBDB69D then
                touchDown(2, 420,290);
                touchUp(2);
             end
        mSleep(80);

         xx = getColor(175,86);
             if xx=="0x813C00" then
                touchDown(3, 175,86);
                touchUp(3);
             end
        mSleep(80);

         xx = getColor(384,95);
             if xx=="0x470E11" then
                touchDown(4, 384,95);
                touchUp(4);
             end
        mSleep(80);

         xx = getColor(567,71);
             if xx=="0x7C7011" then
                touchDown(5, 567,71);
                touchUp(5);
             end
        mSleep(80);

         xx = getColor(443,313);
             if xx=="0x464B0A" then
                touchDown(6, 443,313);
                touchUp(6);
             end
        mSleep(80);

         xx = getColor(450,470);
             if xx=="0x070D16" then
                touchDown(0, 450,470);
                touchUp(0);
             end
        mSleep(80);

end
作者: braxus    時間: 2014-8-4 12:19
不是沒爬文
不是沒研究
更不是重覆貼文

SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function main()

--一般走路
             if getColor(310,86) == 0x73451A then
                mSleep(200);
                touchDown(1, 310,86)
                mSleep(50);
                touchUp(1)
             else
                mSleep(250);
             end
--獲得卡片
             if getColor(420,290) == 0xBDB69D then
                mSleep(200);
                touchDown(2, 420,290);
                mSleep(50);
                touchUp(2);
             else
                mSleep(250);
             end
--戰鬥
             if getColor(175,86) == 0x813C00 then
                mSleep(200);
                touchDown(3, 175,86);
                mSleep(50);
                touchUp(3);
             else
                mSleep(250);
             end
--略過
             if getColor(384,95) == 0x470E11 then
                mSleep(200);
                touchDown(4, 384,95);
                mSleep(50);
                touchUp(4);
             else
                mSleep(250);
             end
--黃勾確定
             if getColor(567,71) == 0x7C7011 then
                mSleep(200);
                touchDown(5, 567,71);
                mSleep(50);
                touchUp(5);
             else
                mSleep(250);
             end
        mSleep(80);
--取消
             if getColor(443,313) == 0x464B0A then
                mSleep(200);
                touchDown(6, 443,313);
                mSleep(50);
                touchUp(6);
             else
                mSleep(250);
             end
--使用黃藍
             if getColor(450,470) == 0x070D16 then
                mSleep(200);
                touchDown(7, 450,470);
                touchUp(7);
             else
                mSleep(250);
             end

end

作者: braxus    時間: 2014-8-4 12:20
不是沒研究
不是沒爬文
更不是重複貼文!!!!
只是不動的就不動
能動的點了第一個就呆了
我就是新手 不然來問你們這些高手作啥???


SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function main()

--一般走路
             if getColor(310,86) == 0x73451A then
                mSleep(200);
                touchDown(1, 310,86)
                mSleep(50);
                touchUp(1)

--獲得卡片
             elseif getColor(420,290) == 0xBDB69D then
                mSleep(200);
                touchDown(2, 420,290);
                mSleep(50);
                touchUp(2);

--戰鬥
             elseif getColor(175,86) == 0x813C00 then
                mSleep(200);
                touchDown(3, 175,86);
                mSleep(50);
                touchUp(3);

--略過
             elseif getColor(384,95) == 0x470E11 then
                mSleep(200);
                touchDown(4, 384,95);
                mSleep(50);
                touchUp(4);

--黃勾確定
             elseif getColor(567,71) == 0x7C7011 then
                mSleep(200);
                touchDown(5, 567,71);
                mSleep(50);
                touchUp(5);

--取消
             elseif getColor(443,313) == 0x464B0A then
                mSleep(200);
                touchDown(6, 443,313);
                mSleep(50);
                touchUp(6);

--使用黃藍
             elseif getColor(450,470) == 0x070D16 then
                mSleep(200);
                touchDown(7, 450,470);
                touchUp(7);
             end

end

作者: zepme3    時間: 2014-8-4 13:40
我不是高手, 只是覺得如果一直用IF THEN ELSE 做LOOP, 最頭的判斷應該最難發生, 最尾先係最常發生, 如果唔係你會永遠只行到第一個判斷.

打個比如, 如果正常畫面走路, 出怪要按戰鬥, 冇血要補血, 打完要略過,
可能先判斷應否補血, 再判斷打怪, 再判斷按確定略過, 再判斷走路, 確實係點就要睇你隻GAME 啲色點擺位了.

希望幫到手啦. 我都只係識少少...
作者: kimououo    時間: 2014-8-4 14:43
cc = getColor(92, 724); if cc == 48846 then         mSleep(400);         touchDown(0, 88, 672);         mSleep(71);         touchUp(0);  end
作者: braxus    時間: 2014-8-4 17:52
小弟又擠出另外一段了
可是還是點第一個之後就停了
小弟的觸摸精靈是iOS版.....不知道 會不會是這個問題??

新的這段請高手們幫我看看,也是停在點了第一點之後

SCREEN_RESOLUTION="768x1024";
SCREEN_COLOR_BITS=32;

function click(x, y)            -- 點擊函數
        touchDown(0, x, y);
        mSleep(100);
        touchUp(0);
end
   
function run_check(check_list)
    for i = 1,#check_list do

        x1 = check_list[i]["c_x"];
        y1 = check_list[i]["c_y"];
        a = check_list[i]["c_c"];
        x = getColor(x1, y1);
        if x==a then
            click(x1,y1);
            break
        end
    end
    mSleep(300);
    run_check(check_list);
end

function main()

    local check_list = {
        {c_x=310,c_y=86,c_c=0x73451A}, --一般走路
        {c_x=420,c_y=320,c_c=0xC8C1A6}, --獲得卡片
        {c_x=175,c_y=86,c_c=0x813C00}, --戰鬥
        {c_x=384,c_y=95,c_c=0x470E11}, --略過
        {c_x=567,c_y=71,c_c=0x7C7011}, --黃勾確定
        {c_x=443,c_y=313,c_c=0x464B0A}, --取消
        {c_x=450,c_y=470,c_c=0x070D16}, --使用黃藍
    }

    run_check(check_list);

end




歡迎光臨 Android 台灣中文網 (https://apk.tw/) Powered by Discuz! X3.1