This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TigerAlen's profile picture

bios:14: [string "Balcony7"]:25: '(' expected

Started by TigerAlen, 14 February 2016 - 09:08 AM
TigerAlen #1
Posted 14 February 2016 - 10:08 AM
I was trying to make an os but i keep getting an error, what did i do wrong?

slc = 0
tBarC = 32
tBartC = 1
backColor = 8
term.clear()
function titleBar()
  term.setCursorPos(1,18)
  term.setBackgroundColor(tBarC)
  term.setTextColor(tBartC)
  term.clearLine()
  term.setCursorPos(3,18)
  print("[Start]")
end
function drawDesktop()
  term.clear()
  bground = paintutils.loadImage(".background")
  paintutils.drawImage(bground,1,1)
  titleBar()
end
function drawMenu1
term.setTextColor(colors.orange)
term.setBackgroundColor(16384)
term.setCursorPos(1,17)
print("            ")
term.setCursorPos(1,16)
print("  Shutdown  ")
term.setCursorPos(1,15)
print("  Restart   ")
term.setCursorPos(1,14)
print("            ")
end
drawDesktop()
while true do
local event, button, x, y = os.pullEventRaw()
  if slc == 0 then
    if event == "mouse_click" then
      if X >=2 and X <=9 and Y==18 and button ==1 then
      drawMenu1()
      slc = 1
        else
        drawDesktop()
      end
    end
  elseif slc == 1 then
    if X >=1 and X <=12 and button ==1 and Y == 16 then slc = 0
      os.shutdown()
      elseif X >=1 and X<=12 and button == 1 and Y == 15 then slc = 0
      os.reboot()
      else
      slc = 0
      drawDesktop()
    end
  end
end
Edited by
Bomb Bloke #2
Posted 14 February 2016 - 11:41 AM
It's telling you that around the 25th line, you stuck an unexpected symbol. It's suggesting that a "(" would've been appropriate.

And indeed, half way down the script we've got:

function drawMenu1

… and the next line launches into more code, without the required brackets that should've come after "drawMenu1".
TigerAlen #3
Posted 15 February 2016 - 02:08 AM
Ok, i get it, thanks