function main()
::拋竿::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/拋竿.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("以拋竿");
else
notifyMessage("找不到拋竿")
goto 補電力;
end
end
mSleep(4000);
::上勾::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/上勾.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("以上勾");
else
notifyMessage("上勾失敗")
goto 繼續釣魚;
end
end
mSleep(2000);
::清除確認視窗::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/打x.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("清除確認視窗");
else
notifyMessage("搜尋不到確認視窗")
end
end
mSleep(2000);
::賣出::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/賣魚.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("成功賣出");
else
notifyMessage("無法賣出")
end
end
mSleep(2000);
::繼續釣魚::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/繼續釣魚.bmp");
if x ~= -1 and y ~= -1 then
touchUp(0);
notifyMessage("繼續釣魚");
else
notifyMessage("找不到繼續釣魚")
end
end
goto 拋竿;
mSleep(1000);
::補電力::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/使用電池.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
mSleep(500);
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("以補電力");
else
notifyMessage("免補電力")
goto 繼續釣魚;
end
end
mSleep(1000);
::補完電力::
x, y = findImage("/storage/sdcard0/Touchelper/ABC/打x.bmp");
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
touchUp(0);
notifyMessage("補完清除視窗");
else
notifyMessage("搜尋不到確認視窗")
end
end
goto 繼續釣魚;作者: 有本書 時間: 2014-1-27 22:42
我有發教學文自己去看看
看不懂的話... goto xxxx; <<<<< ";" 這個鬼東東是多的~請果斷刪除試試作者: ps74747744 時間: 2014-1-28 19:07
::aa::
x, y = findImage(storage/sdcard0/Touchelper/ABC/拋竿.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以拋竿);
else
notifyMessage(找不到拋竿)
goto ee;
end
end
mSleep(4000);
::bb::
x, y = findImage(storage/sdcard0/Touchelper/ABC/上勾.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以上勾);
else
notifyMessage(上勾失敗)
goto ee;
end
end
mSleep(2000);
::cc::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(清除確認視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
mSleep(2000);
::dd::
x, y = findImage(storage/sdcard0/Touchelper/ABC/賣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(成功賣出);
else
notifyMessage(無法賣出)
end
end
mSleep(2000);
::ee::
x, y = findImage(storage/sdcard0/Touchelper/ABC/繼續釣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(繼續釣魚);
else
notifyMessage(找不到繼續釣魚)
end
end
goto aa;
mSleep(1000);
::ff::
x, y = findImage(storage/sdcard0/Touchelper/ABC/使用電池.bmp,90);
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
click(x, y)
mSleep(1000);
touchDown(0, x+5, y+5);
click(x, y)
notifyMessage(以補電力);
else
notifyMessage(免補電力c)
goto ee;
end
end
mSleep(1000);
::gg::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(補完清除視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
goto ee;
end作者: ps74747744 時間: 2014-1-28 19:09
有本書大大 我腳本改成這樣還是語法錯誤
問題出再哪呢? 找不到問題點
::aa::
x, y = findImage(storage/sdcard0/Touchelper/ABC/拋竿.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以拋竿);
else
notifyMessage(找不到拋竿)
goto ee
end
end
mSleep(4000);
::bb::
x, y = findImage(storage/sdcard0/Touchelper/ABC/上勾.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以上勾);
else
notifyMessage(上勾失敗)
goto ee
end
end
mSleep(2000);
::cc::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(清除確認視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
mSleep(2000);
::dd::
x, y = findImage(storage/sdcard0/Touchelper/ABC/賣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(成功賣出);
else
notifyMessage(無法賣出)
end
end
mSleep(2000);
::ee::
x, y = findImage(storage/sdcard0/Touchelper/ABC/繼續釣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(繼續釣魚);
else
notifyMessage(找不到繼續釣魚)
end
end
goto aa
mSleep(1000);
::ff::
x, y = findImage(storage/sdcard0/Touchelper/ABC/使用電池.bmp,90);
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
click(x, y)
mSleep(1000);
touchDown(0, x+5, y+5);
click(x, y)
notifyMessage(以補電力);
else
notifyMessage(免補電力c)
goto ee
end
end
mSleep(1000);
::gg::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(補完清除視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
goto ee
end::aa::
x, y = findImage(storage/sdcard0/Touchelper/ABC/拋竿.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以拋竿);
else
notifyMessage(找不到拋竿)
goto ee
end
end
mSleep(4000);
::bb::
x, y = findImage(storage/sdcard0/Touchelper/ABC/上勾.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(以上勾);
else
notifyMessage(上勾失敗)
goto ee
end
end
mSleep(2000);
::cc::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(清除確認視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
mSleep(2000);
::dd::
x, y = findImage(storage/sdcard0/Touchelper/ABC/賣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(成功賣出);
else
notifyMessage(無法賣出)
end
end
mSleep(2000);
::ee::
x, y = findImage(storage/sdcard0/Touchelper/ABC/繼續釣魚.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(繼續釣魚);
else
notifyMessage(找不到繼續釣魚)
end
end
goto aa
mSleep(1000);
::ff::
x, y = findImage(storage/sdcard0/Touchelper/ABC/使用電池.bmp,90);
if x ~= -1 and y ~= -1 then
touchDown(0, x+5, y+5);
click(x, y)
mSleep(1000);
touchDown(0, x+5, y+5);
click(x, y)
notifyMessage(以補電力);
else
notifyMessage(免補電力c)
goto ee
end
end
mSleep(1000);
::gg::
x, y = findImage(storage/sdcard0/Touchelper/ABC/打x.bmp,90);
if x ~= -1 and y ~= -1 then
click(x, y)
notifyMessage(補完清除視窗);
else
notifyMessage(搜尋不到確認視窗)
end
end
goto ee
end作者: ps74747744 時間: 2014-1-29 12:46
有本書 大大 我懷疑是否是::標記:: 這符號有誤
因為剛寫了以下判圖喊話測試
去掉::標記:: 即可正常開始
加上::標記:: 又語法錯誤
為何會這樣呢?
function main()
::1::
x, y = findImage("storage/sdcard0/Touchelper/ABC/拋竿.bmp");
if x ~= -1 and y ~= -1 then
click(x, y);
mSleep(1000);
notifyMessage("ok");
else
mSleep(1000);
notifyMessage("no")
end
::2::
mSleep(1000)
x, y = findImage("storage/sdcard0/Touchelper/ABC/上勾.bmp");
if x ~= -1 and y ~= -1 then
click(x, y);
mSleep(1000);
notifyMessage("ok2");
else
mSleep(1000);
notifyMessage("no2")
end
::3::
mSleep(1000)
x, y = findImage("storage/sdcard0/Touchelper/ABC/賣魚.bmp");
if x ~= -1 and y ~= -1 then
click(x, y);
mSleep(1000);
notifyMessage("ok3");
else
mSleep(1000);
notifyMessage("no3")
end
end作者: 有本書 時間: 2014-1-29 13:16
標記和跳轉標記不得用英文以外的,不如你把錯誤訊息截圖下來 我看看作者: ps74747744 時間: 2014-1-29 16:47 本帖最後由 ps74747744 於 2014-1-29 16:48 編輯