-1

在我的计算机飞行器程序中,将在我的机场地图中的控制塔中使用,我收到一条消息,如下所示:

BIOS:367:[字符串“AirportCommand”]:15:语法错误

这是我所有的代码,如果您发现任何错误,请告诉我:

local Landing_open = true
rednet.open("top")

while true do

  id, message, distance = rednet.receive()

  if message == "Requesting Landing" and Landing_open == true and distance<500 then
    rednet.send(id, "Landing is granted. Please respond with Landing finished when you exit the runway.")
    Landing_open = false

   elseif message == "Requesting Landing" and distance>=500 then
     rednet,send(id, "Landing is not granted. Please try again when you are closer to the airport,")

   elseif message == "Requesting Landing" and Landing_open == false then
    rednet.send(id, "Landing is not granted. Please try again later.")

   elseif message == "Landing Finished" then
    rednet.send(id, "Roger that")
    Landing_open = true
4

1 回答 1

0

首先:如果这是您的完整代码,它将无法工作!你不会关闭你的if或你的while结构。

尝试将您的代码扩展两个end. 一个关闭你的if结构,一个关闭你while

于 2015-07-29T07:28:57.957 回答