Jump to content




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

computer help

  • You cannot reply to this topic
15 replies to this topic

#1 braydenq6

  • Members
  • 13 posts

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()

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.

#3 braydenq6

  • Members
  • 13 posts

Posted 23 January 2016 - 03:51 AM

I fixed that still has same error

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.

#5 braydenq6

  • Members
  • 13 posts

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

#6 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 23 January 2016 - 08:48 PM

Try changing this to a single equals sign (line 12 I believe):

drawMenu1 == function() 


#7 braydenq6

  • Members
  • 13 posts

Posted 23 January 2016 - 08:49 PM

Ill try that

#8 braydenq6

  • Members
  • 13 posts

Posted 24 January 2016 - 05:57 AM

It dident work it sead it was unexpected

#9 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 24 January 2016 - 06:00 AM

What was unexpected where, exactly?

That is to say - post the whole error message.

#10 braydenq6

  • Members
  • 13 posts

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

#11 braydenq6

  • Members
  • 13 posts

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

#12 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.

#13 braydenq6

  • Members
  • 13 posts

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

#14 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 24 January 2016 - 07:10 AM

View Postbraydenq6, on 24 January 2016 - 06:24 AM, said:

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] [/.code] tags (without the period)

#15 braydenq6

  • Members
  • 13 posts

Posted 24 January 2016 - 06:27 PM

Thank you for simplify that

#16 braydenq6

  • Members
  • 13 posts

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users