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

bios. lua:14: [string "gui"]:13: unexpected symbol

Started by braydenq6, 19 January 2016 - 04:33 AM
braydenq6 #1
Posted 19 January 2016 - 05:33 AM
–Varibles
version = 3.0 running = true
–Images
_dt = paintutils.loadImage("/os/.backgrounds/dt")
–Booleans _ms =
–Functions
clear = function() term.setBackgroundColor(colors.orange) term.clear() term.setCursorPos(1, 1) end
drawMenu1 == function() term.setCursorPos(1, 2) term.setBackgroundColor(colors.white) term.setTextColor(colors.red) print("[power]")
while true do
end
drawTaskBar = function() term.setCursorPos(1, 1) term.setBackgroundColor(colors.red) term.clearLine() term.setCursorPos(1, 1) term.setBackgroundColor(colors.lime) term.setTextColor(colors.white) term.write("[Menu]") end
drawDeskTop = function() term.setBackgroundColor(colors.orange) term.clear() term.setCursorPos(1, 1) paintutils.drawImage(_dt, 1 ,1) end
stop = function() clear() running = false

term.setTextColor(colors.lime print("Thanks for using BZGamingOS")
end
runTime = function()
while running do event, button, x, y =os.pullEvent("mouse_click")
if _ms == 0 button == 1 and x < 7 and y == 1 then drawMenu1() _ms = 1 elseif _ms == 1 and button == 1 and y == 2 and x < 7 then stop()
elseif _ms == 1 and button == 1 and x < 7 and y == 1 then
init()
end
end
end
init = function()
_ms = 0 drawDeskTop()
drawTaskBar()
runTime()
end
–Main Stuff
init()
Bomb Bloke #2
Posted 19 January 2016 - 05:42 AM
Methinks you've got your line numbers mixed up; first incorrect symbol that stands out at me is on this line:

term.setTextColor(colors.lime print("Thanks for using BZGamingOS")

You've got a "p" where a bracket or comma should go.

It also looks a bit like your "end"s are messed up throughout the script. Consider splitting up your statements into individual lines, and indenting correctly - you'll find it a lot easier to track your problems.
braydenq6 #3
Posted 23 January 2016 - 03:51 AM
I fixed that still has same error
Bomb Bloke #4
Posted 23 January 2016 - 04:49 AM
If you really addressed all those issue, at the very least your error would now point to a different line number. Post the new code.
braydenq6 #5
Posted 23 January 2016 - 08:38 PM
–Varibles
version = 3.0 running = true

–Images
_dt = paintutils.loadImage("/os/.backgrounds/dt")
–Booleans _ms =

–Functions
clear = function() term.setBackgroundColor(colors.orange) term.clear()
term.setCursorPos(1, 1)
end
drawMenu1 == function()
term.setCursorPos(1, 2) term.setBackgroundColor(colors.white) term.setTextColor(colors.red) print("[power]")
while true do
end
drawTaskBar = function()
term.setCursorPos(1, 1) term.setBackgroundColor(colors.red) term.clearLine() term.setCursorPos(1, 1) term.setBackgroundColor(colors.lime) term.setTextColor(colors.white)
term.write("[Menu]")
end
drawDeskTop = function() term.setBackgroundColor(colors.orange) term.clear() term.setCursorPos(1, 1) paintutils.drawImage(_dt, 1 ,1)
end
stop = function() clear() running = false

term.setTextColor(colors.lime print("Thanks for using BZGamingOS") 
end
runTime = function() 
while running do event, button, x, y os.pullEvent("mouse_click") 
if _ms == 0 button == 1 and x < 7 and y == 1 then drawMenu1()
_ms = 1 elseif _ms == 1 and button == 1 and y == 2 and x < 7 then stop()
elseif _ms == 1 and button == 1 and x < 7 and y == 1 then 
init() 
end 
end 
end
init = function() 
_ms = 0 drawDeskTop() 
drawTaskBar() 
runTime() 
end

–Main Stuff 
init()

Id fixed some others to it just conpressed it

All ther terms are on the line down
HPWebcamAble #6
Posted 23 January 2016 - 08:48 PM
Try changing this to a single equals sign (line 12 I believe):


drawMenu1 == function() 
braydenq6 #7
Posted 23 January 2016 - 08:49 PM
Ill try that
braydenq6 #8
Posted 24 January 2016 - 05:57 AM
It dident work it sead it was unexpected
Bomb Bloke #9
Posted 24 January 2016 - 06:00 AM
What was unexpected where, exactly?

That is to say - post the whole error message.
braydenq6 #10
Posted 24 January 2016 - 06:07 AM
I fixed one i deleted th _ma =
I now get this error bios:14: [string ".temp"]:19: '=' expected

On line six after Booleans
braydenq6 #11
Posted 24 January 2016 - 06:24 AM
I fixed that error now i have
bios :14: [string ".temp"] :57: 'then' expected

–Varibles
version = 3.0 running = true

–Images
_dt = paintutils.loadImage("/os/.backgrounds/dt")
–Booleans
_ms = 0

–Functions
clear = function() term.setBackgroundColor(colors.orange) term.clear() 
term.setCursorPos(1, 1) 
end
drawMenu1 = function() 
term.setCursorPos(1, 2) term.setBackgroundColor(colors.white) term.setTextColor(colors.red) print("[power]")
while true do
end
drawTaskBar = function()
term.setCursorPos(1, 1) term.setBackgroundColor(colors.red) term.clearLine()
term.setCursorPos(1, 1) term.setBackgroundColor(colors.lime) term.setTextColor(colors.white) 
term.write("[Menu]") 
end
drawDeskTop = function() term.setBackgroundColor(colors.orange)
term.clear()
term.setCursorPos(1, 1)
paintutils.drawImage(_dt, 1 ,1) 
end
stop = function()
clear()
running = false

term.setTextColor(colors.lime print("Thanks for using BZGamingOS") 
end
runTime = function() 
while running do event, button, x, y os.pullEvent("mouse_click") 
if _ms == 0 button == 1 and x < 7 and y == 1 then drawMenu1() 
_ms = 1 elseif _ms == 1 and button == 1 and y == 2 and x < 7 then stop()
elseif _ms == 1 and button == 1 and x < 7 and y == 1 then 
init() 
end 
end 
end
init = function() 
_ms = 0 drawDeskTop() 
drawTaskBar() 
runTime() 
end

–Main Stuff 
init()

New code
Bomb Bloke #12
Posted 24 January 2016 - 06:25 AM
The number 57 tells you the line the error is on. You've got something there that shouldn't be - like a single equals sign, perhaps - and so the interpreter is asking if you meant to put a "then" in that particular spot.
braydenq6 #13
Posted 24 January 2016 - 06:29 AM
Just copied the last one and edited dont liesen to code at top of this post

Disingard this post i forgot it if you commet after your self it up dates previous post
HPWebcamAble #14
Posted 24 January 2016 - 07:10 AM
I fixed that error now i have
bios :14: [string ".temp"] :57: 'then' expected

A few things:
  • That code is only 49 lines
  • Please indent your code, makes it easier to read and spot missing 'end's and such
  • While that's a perfectly valid way to define functions, it makes your code a bit messier
  • I've fixed the formatting and syntax (but not the logic) of your code:

--Varibles
version = 3.0 
running = true
_dt = paintutils.loadImage("/os/.backgrounds/dt")
_ms = 0

--Functions
function clear() 
  term.setBackgroundColor(colors.orange) 
  term.clear() 
  term.setCursorPos(1, 1) 
end

function drawMenu1()
  term.setCursorPos(1, 2)
  term.setBackgroundColor(colors.white)
  term.setTextColor(colors.red)
  print("[power]")
end

function drawTaskBar()
  term.setCursorPos(1, 1) term.setBackgroundColor(colors.red) term.clearLine()
  term.setCursorPos(1, 1) term.setBackgroundColor(colors.lime) term.setTextColor(colors.white) 
  term.write("[Menu]") 
end

function drawDeskTop()
  term.setBackgroundColor(colors.orange)
  term.clear()
  term.setCursorPos(1, 1)
  paintutils.drawImage(_dt, 1 ,1) 
end

function stop()
  clear() 
  running = false
  term.setTextColor(colors.lime) 
  print("Thanks for using BZGamingOS") 
end

function runTime() 
  while running do 
    local event, button, x, y = os.pullEvent("mouse_click") 
    if _ms == 0 and button == 1 and x < 7 and y == 1 then 
      drawMenu1() 
      _ms = 1 
    elseif _ms == 1 and button == 1 and y == 2 and x < 7 then 
      stop()
    elseif _ms == 1 and button == 1 and x < 7 and y == 1 then 
      init() 
    end 
  end 
end

function init() 
  _ms = 0 
  drawDeskTop() 
  drawTaskBar() 
  runTime() 
end

--Main Stuff 
init()

Finally, put your code between
 [/.code] tags (without the period)
braydenq6 #15
Posted 24 January 2016 - 06:27 PM
Thank you for simplify that
braydenq6 #16
Posted 24 January 2016 - 07:26 PM
I fixed it ther was a missing and on line in the 40's thers no more errors, thanks bomb bloke and HPWebcamAble for the help