【问题标题】:compiling .lua to exe [duplicate]将.lua编译为exe [重复]
【发布时间】:2016-05-17 20:15:45
【问题描述】:

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

函数 OnEvent(event, 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)致命:语法错误,预期“开始”但找到“标识符循环” 致命:编译中止,我对编程还很陌生,我想知道出了什么问题

【问题讨论】:

  • 每种语言,甚至是一种语言的每个特定变体,都需要自己特定的编译器或解释器。您不能混合使用语言和编译器并期望任何有意义的结果。因此,Pascal 编译器无法编译 Lua 程序,就像 Lua 解释器无法运行 Pascal 程序一样。

标签: lua exe


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-06
    • 2012-05-15
    • 2013-07-19
    • 1970-01-01
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多