Posted 24 August 2016 - 09:47 PM
I am getting an error on my computercraft os. This is the error:
bios.lua:14: [string ".temp"]:137: '<eof>' expected
Heres the code I am using: (kinda long)
-Desktop
slc = 0
tBarC = 128
tBartC = 32768
startMenuText = 32768
backColor = 1
term.setBackgroundColor( colors.cyan )
term.clear()
contextX = 0
contextY = 0
menu = 0
function titleBar()
term.setCursorPos(1,1)
term.setBackgroundColor(tBarC)
term.setTextColor(tBartC)
term.clearLine()
term.setCursorPos(3, 1)
print("[Start]")
term.setCursorPos(44,1)
print("Settings")
end
function drawDesktop()
term.setBackgroundColor(backColor)
term.clear()
bground = paintutils.loadImage("MARCOOS/desktop/bg")
paintutils.drawImage(bground,2,2)
icon = paintutils.loadImage("MARCOOS/desktop/icons/File")
paintutils.drawImage(icon,2,3)
term.setBackgroundColor(backColor)
term.setTextColor(128)
term.setCursorPos(4,9)
print("File")
term.setCursorPos(35,16)
term.setBackgroundColor(colors.cyan)
print("MarcoOS 0.0 Beta")
term.setCursorPos(40,17)
print("Build")
term.setCursorPos(47,17)
print(fs.getSize("MARCOOS/desktop/desktop"))
end
function drawMenu1()
menu = 1
term.setTextColor(startMenuText)
term.setBackgroundColor(128)
term.setCursorPos(1,2)
print(" ")
term.setCursorPos(1,3)
print(" Shutdown>")
term.setCursorPos(1,4)
print(" Sleep >")
term.setCursorPos(1,5)
print(" ")
term.setCursorPos(1,6)
print(" Shell ")
term.setCursorPos(1,7)
print(" ")
end
function drawMenu2()
term.setBackgroundColor(128)
term.setTextColor(startMenuText)
term.setCursorPos(contextX, contextY)
print(" ")
term.setCursorPos(contextX, contextY+1)
print(" Edit BG ")
term.setCursorPos(contextX, contextY+2)
print(" ")
end
function drawMenu3()
menu = 2
term.setBackgroundColor(128)
term.setTextColor(startMenuText)
term.setCursorPos(11,3)
print(" ")
term.setCursorPos(11,4)
print(" Shutdown ")
term.setCursorPos(11,5)
print(" Restart ")
term.setCursorPos(11,6)
print(" ")
end
function Shell()
term.clear()
term.setCursorPos(1,1)
term.setBackgroundColor( colors.black )
print("INFO: Type exit to return to Marco-OS")
end
drawDesktop()
titleBar()
term.setBackgroundColor(colors.gray)
term.setCursorPos(44,1)
print("Settings")
while true do
local event, button, X, Y = os.pullEventRaw()
if slc == 0 then
if event == "mouse_click" then
if X >=2 and X <=8 and Y==1 and button ==1 then
drawMenu1()
slc = 0
elseif X >=4 and X<=8 and Y==9 and button == 1 then
shell.run("Browser")
elseif X>=44 and X<=51 and Y==1 and button == 1 then slc = 0
shell.run("PROGRAMS/settings/settings")
elseif menu == 1 then
if X>=2 and X<=11 and Y==3 and button ==1 then
drawMenu3()
elseif X>=1 and X<=11 and Y==4 and button ==1 then
os.reboot()
end
elseif menu == 2 then
if X>=12 and X<=20 and Y==4 and button ==1 then
os.shutdown()
elseif X>=12 and X<=18 and Y==5 and button ==1 then
os.reboot()
elseif slc == 0 then
if X>=44 and X<=51 and Y==1 and button ==1 then
shell.run("PROGRAMS/settings/settings")
end
elseif X>= 3 and X <=8 and Y==9 and button == 1 then slc = 0
shell.run("Browser")
drawDesktop()
else slc = 0
drawDesktop()
end
end
end
end
end
end
end