Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 我的代码没有';我不想在一个名为Xenobot/XenoSuite的程序上执行,我的if-then函数不';行不通_Lua - Fatal编程技术网

Lua 我的代码没有';我不想在一个名为Xenobot/XenoSuite的程序上执行,我的if-then函数不';行不通

Lua 我的代码没有';我不想在一个名为Xenobot/XenoSuite的程序上执行,我的if-then函数不';行不通,lua,Lua,所以我刚刚开始学习Lua编码,我在youtube上跟踪了一些人的在线代码,我逐字逐句地做了他所做的事情。当我执行代码时,它不工作。有人能给我解释一下是什么吗?有什么错就重写一下。谢谢我已经用下面的所有内容运行了几次代码。不起作用的一行是说if(labelName==“Venore”)then。其他一切都可以。我已经分别运行了它们,当我在代码中键入一行代码时,它不想被执行,也不想在脚本中运行。我不知道我是否写错了什么,但这正是代码的样子 我想做的是为游戏创建一个自动脚本,如果在“Walker”中有

所以我刚刚开始学习Lua编码,我在youtube上跟踪了一些人的在线代码,我逐字逐句地做了他所做的事情。当我执行代码时,它不工作。有人能给我解释一下是什么吗?有什么错就重写一下。谢谢我已经用下面的所有内容运行了几次代码。不起作用的一行是说if(labelName==“Venore”)then。其他一切都可以。我已经分别运行了它们,当我在代码中键入一行代码时,它不想被执行,也不想在脚本中运行。我不知道我是否写错了什么,但这正是代码的样子

我想做的是为游戏创建一个自动脚本,如果在“Walker”中有一个标签,在游戏中,你可以创建标签,我希望这些是脚本检查的检查点。当检测到标签时,它将执行代码,例如,如果我在“Walker”部分键入“Venore”,它将执行检测到“Venore”的部分

此代码用于名为胫骨的游戏,此代码用于名为Xenobot/Xenosuite的程序。我还使用notepad++编写了这段代码。我一直在关注这段youtube视频,试图理解我的代码为什么不起作用。我遵循了上面的所有说明,我的代码看起来与视频中的代码完全一样,但是程序不想执行。这里是我使用的youtube视频的链接,我希望所有这些信息都能有所帮助

----- Mana Potions -----
local ManaMin = 50 --- How many mana potions until you leave the hunt
local ManaMax = 300 --- How many mana poitions you begin with
local ManaID = 237 --- ID Strong Health Potion
local ManaCost = 100 --- Price of Strong Mana Potion

----- Health Potions -----
local HealthMin = 0 --- How many health potions until you leave the hunt
local HealthMax = 0 --- How many mana poitions you begin with
local HealthID = 236 --- ID Strong Mana Potion
local HealthCost = 100 --- Price of Strong Health Potion

----- Other Options -----
local MainBp = 10234
local ItemBp = 2867
local GoldBp = 2671
local StackBp = 5949
local SuppliesBp = 2868
local RingBp = 10234
local MinCap = 100

local UsingSoftBoots = true
local HideEquipment = true

---------------------------------------
---------------------------------------
---------------------------------------
---------------------------------------
---------------------------------------



Targeting.Start()
Looter.Start()

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

local info = [[]]
    wait(5000)
    
    print([[
    --<Hello and welcome to my code>--]])
    wait(3000)
    
------------------------------------------------------------------------------------------
function onWalkerSelectLabel(labelName)
if (labelName == "Venore") then
    setWalkerEnabled(false)
        delayWalker(5000)
            Self.Say("Hi")
            sleep(math.random(700, 1400))
            Self.SayToNpc("Venore")
            sleep(math.random(300, 1000))
            Self.SayToNpc("Yes")
        setWalkerEnabled(true)

end
——法力药剂-----
本地法力值=50---在你离开狩猎之前有多少法力药水
本地法力上限=300--你开始时有多少法力点
本地玛瑙=237---ID强效药水
本地法力消耗=100--强力法力药水的价格
-----保健药水-----
local HealthMin=0---在你离开狩猎之前有多少药水
本地HealthMax=0---你开始时有多少法力点
本地健康ID=236--ID强力法力药剂
本地健康成本=100---强效健康药水价格
-----其他选择-----
本地MainBp=10234
本地项目BP=2867
本地GoldBp=2671
本地堆栈bp=5949
本地供应量Bp=2868
本地环bp=10234
本地最小上限=100
本地UsingSoftBoots=true
本地隐藏设备=真
---------------------------------------
---------------------------------------
---------------------------------------
---------------------------------------
---------------------------------------
Targeting.Start()
掠夺者开始
registerEventListener(WALKER\u SELECTLABEL,“onWalkerSelectLabel”)
本地信息=[]]
等待(5000)
印刷品([[
----]])
等待(3000)
------------------------------------------------------------------------------------------
函数onWalkerSelectLabel(labelName)
如果(labelName==“Venore”),则
setWalkerEnabled(错误)
delayWalker(5000)
赛尔夫说:“嗨”
睡眠(数学随机(7001400))
Self.SayToNpc(“Venore”)
睡眠(数学随机(3001000))
Self.SayToNpc(“是”)
setWalkerEnabled(真)
结束
如果您在代码中看到“If(labelName==”Venore“)then”部分,其中表示Venore,这是游戏中的一个城市,因此当角色上船时,它将与npc通信并前往Venore。当涉及到在机器人周围移动角色时,这一切都已经发生了,并且在第一张图像中,您看到了所有标签。节点是机器人告诉角色移动的位置


现在还不能发布图片。如果可以的话,对不起会容易得多。我希望所有这些都能有所帮助,如果没有的话,我可以提供更多的信息。

所以基本上我发现了问题所在,我所要做的就是在脚本中添加“end”,现在就可以了。

标签的价值是什么?打印出来!