编译 .lua 到 exe

compiling .lua to exe

我正在尝试编译我的脚本` 循环次数= 100

函数 OnEvent(事件,arg)

如果按键(0x61)则

x1, y1 = GetMousePosition()

结束

if keypress(0x62) then
    i = 0

    while (i<loops) do
        if IsModifierPressed("lshift") then
        i = loops
        end
        ReleaseKey("lshift")

        if not IsModifierPressed("lshift") then

            i=i+1
        move1 = math.random(1300,1400)
        move2 = math.random(1300,1400)
        move3 = math.random(1300,1400)
        MoveMouseTo(x1,y1)
        Sleep(math.random(75,100))
        PressMouseButton(3)
        Sleep(math.random(75,100))
        ReleaseMouseButton(3)
        Sleep(math.random(75,100))
        x1 = x1+move1
        MoveMouseTo(x1,y1)
            Sleep(math.random(75,100))
        PressMouseButton(1)
        Sleep(math.random(75,100))
            ReleaseMouseButton(1)
            Sleep(math.random(75,100))
        if IsModifierPressed("lshift") then
        i = loops
        end
        ReleaseKey("lshift")

        MoveMouseTo(x1,y1)
        Sleep(math.random(75,100))
        PressMouseButton(3)
        Sleep(math.random(75,100))
        ReleaseMouseButton(3)
        Sleep(math.random(75,100))
        x1 = x1+move2
        MoveMouseTo(x1,y1)
            Sleep(math.random(75,100))
        PressMouseButton(1)
        Sleep(math.random(75,100))
            ReleaseMouseButton(1)
            Sleep(math.random(75,100))
        if IsModifierPressed("lshift") then
        i = loops
        end
        ReleaseKey("lshift")

        MoveMouseTo(x1,y1)
        Sleep(math.random(75,100))
        PressMouseButton(3)
        Sleep(math.random(75,100))
        ReleaseMouseButton(3)
        Sleep(math.random(75,100))
        x1 = x1+move3
        MoveMouseTo(x1,y1)
            Sleep(math.random(75,100))
        PressMouseButton(1)
        Sleep(math.random(75,100))
            ReleaseMouseButton(1)
            Sleep(math.random(75,100))
        if IsModifierPressed("lshift") then
        i = loops
        end
        ReleaseKey("lshift")

        x1 = x1-move1-move2-move3
    end
end
        MoveMouseTo(x1,y1)
        Sleep(math.random(50,75))
        PressMouseButton(3)
        Sleep(math.random(50,75))
        ReleaseMouseButton(3)
        Sleep(math.random(50,75))
        x1 = x1+move1
        MoveMouseTo(x1,y1)
        Sleep(math.random(50,75))
        PressMouseButton(1)
        Sleep(math.random(50,75))
        ReleaseMouseButton(1)
        x1 = x1-move1

结束 结束` 使用免费的 pascal 编译器进入 .exe,每次我 运行 编译器我都会收到错误 (1,6) Fatal: Syntax error, "BEGIN" expected but "identifier LOOPS" found 致命:编译中止,我对编程还很陌生,我想知道出了什么问题

您似乎正在尝试使用免费的 pascal 编译器编译 Lua 脚本,这不太可能奏效。您可能需要查看此 SO question 以获取有关如何将 lua 脚本编译为可执行文件的信息。