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