綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] 唔知錯咩

[複製連結] 查看: 1401|回覆: 1|好評: 0
跳轉到指定樓層
樓主
s031108 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2014-5-19 23:41

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
本帖最後由 s031108 於 2014-5-19 23:43 編輯

错误:脚本编译出错...
错误代码:3
错误信息:
脚本GG主程序(ALL)1.lua第240行有语法错误, <goto D> at line 209 jumps into the scope of local "flag"

--回en1
::R1::
local flag, x, y = findImageFuzzy(image.."9.bmp", 70, w*490, h*720, w*540, h*770);
if flag then
  toast("GG");
  sleep(wait1);
        touchDown( w*720, h*770);
        sleep(60);
        touchUp();
  sleep(wait1);
  end
local flag2, x, y = findImageFuzzy(image.."6.bmp", 70, 400*w,600*h,450*w,640*h);
if flag2 then
  toast("回en");
  sleep(wait1);
        touchDown( w*430, h*560);
        touchUp();
  sleep(wait1);
  goto R2
  end
209  goto D

--回en1

--回en2
::R2::
local flag, x, y = findImageFuzzy(image.."9.bmp", 70, w*490, h*720, w*540, h*770);
if flag then
  toast("GG");
  sleep(wait1);
        touchDown( w*720, h*770);
        sleep(60);
        touchUp();
  sleep(wait1);
  end
local flag, x, y = findImageFuzzy(image.."7.bmp", 60, w*610, h*580, w*685, h*650);
if flag then
  sleep(wait1);
        touchDown( w*720, h*640);
        sleep(60);
        touchUp();
  sleep(wait1);
  goto C
else
  goto R2
  end
--回en2

--開始1
  toast("開始");
::D::
240 local flag, x, y = findImageFuzzy(image.."9.bmp", 70, w*490, h*720, w*540, h*770);
if flag then
  toast("GG");
  sleep(wait1);
        touchDown( w*720, h*770);
        sleep(60);
        touchUp();
  sleep(wait1);
  end
local flag4, x4, y4 = findImageFuzzy(image.."3.bmp", 80);
if flag4 then
  sleep(wait1);
        touchDown( w*360, h*650);
        sleep(60);
        touchUp();
else
  goto D
  end
::AT::
local flag2, x2, y2 = findImageFuzzy(image.."bs1.bmp", 90, w*690, h*450, w*730, h*490);
if flag2 then
else
goto AT
end
        sleep(800);
        touchDown( w*760, h*970);
        touchUp();
        sleep(400);
        touchDown( w*760, h*970);
        touchUp();
        sleep(400);
        touchDown( w*760, h*970);
        touchUp();
        sleep(400)
        touchDown( w*20, h*70);
        touchUp();
  sleep(wait1);
--開始1
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
antrbangy | 收聽TA | 只看該作者
發表於 2014-8-30 13:54
嗯,這樣貼得很亂看不出來,但我猜測,應該是goto的問題,記得沒錯的話,你是不是有從function main()去呼叫子function,然後從子function直接用goto 回到function main的行數..有試過這樣不行,goto好像只能用在當前的function中..不能跳function..

**--錯誤範例--**
function main()
:f_m
    toast("main")
    son();
end

function son()
   print ("son")
   goto f_m-->因為由子function直接goto回main function,會錯誤.
end


--**正確範例**--
function main()
:f_m
    toast("main")
    son();
    goto f_m-->goto放在同個function是可行的
end

function son()
   print ("son")
end








用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則