Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

On my program for Computer craft that will be used in a control tower in my airport map, I got a message that looked like this:

bios:367:[string "AirportCommand"]:15: syntax error

Here is all my code please tell me if you see any errors:

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
155 views
Welcome To Ask or Share your Answers For Others

1 Answer

First of all: If this is your full code it can't work! you don't close your if nor your while structure.

Try to extend your code by two end. One closes your if structure and one you while


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...