[Computer Craft] '=' Expected error

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

DragonZero

New Member
Jul 29, 2019
4
0
0
I'm trying out CC for the first time and am trying to write code to give me text-based control over the turtle, but I keep getting the error "bios : 366 : [string "control"] : 5 : '=' expected. I have looked up the error, but am unable to find anything wrong in my code in that area. Here is the code.
Code:
local goOn = true
local dir = nil
local dis = nil

While goOn == true do
  print ("Direction? w|a|s|d|e|c|flip|end")
  dir = read()
  if dir == "w" then
    print ("Distance?")
    dis = read()
    turtleW(dis)
  elseif dir == "a" then
    turtle.turnLeft()
  elseif dir == "s" then
    print ("Distance?")
    dis = read()
    turtleS(dis)
  elseif dir == "d" then
    turtle.turnRight()
  elseif dir == "e" then
    print ("Distance?")
    dis = read()
    turtleUp(dis)
  elseif dir == "c" then
    print ("Distance?")
    dis = read()
    turtleDown(dis)
  elseif dir == "flip" then
    turtleFlip()
  elseif dir == "end" then
    print ("Program terminating. Have a nice day.")
    goOn = false
  else
    print ("Invalid command. Program terminating")
    goOn = false
end