local color = getColor(x,y)
if color==你要的顏色 then
你要的事
end 作者: wings7677 時間: 2015-8-26 02:18 本帖最後由 wings7677 於 2015-8-26 02:34 編輯
a = getColor(x,y); --獲取座標x.y的顏色記到a中
if a==0xXXXXXX then --如果座標顏色符合XXXXXX(X就是你知道的顏色值)
touchDown(0,x,y); --手指0按下座標x.y
mSleep(10); --延遲10毫秒
touchUp(0) --手指0抬啟
else --否則
mSleep(10); --延遲10毫秒
end --getColor(x,y);的結束