Posted 04 May 2013 - 09:29 AM
function draw()
desktop = paintutils.loadImage("background")
paintutils.drawImage(image, screenX, 3)
end
local screenX, screenY = term.getSize()
term.clear()
term.setCursorPos(1, 1)
os.sleep(1)
while true do
term.setBackgroundColor(colors.cyan)
term.clear()
paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
term.setTextColor(colors.black)
term.setCursorPos(1, 2)
term.setBackgroundColor(colors.lightBlue)
term.setTextColor(colors.blue)
print("[Studio]")
term.setBackgroundColor(colors.red)
term.setCursorPos(10, 2)
term.setTextColor(colors.lightBlue)
print(" [Programs] ")
term.setCursorPos(30 , 1)
term.setTextColor(colors.black)
term.setBackgroundColor(colors.lightGray)
print("Testing 2")
while true do
local event, button, X, Y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if X >= 1 and X <= 10 and Y == 2 and button == 1 then
print("Welcome to Studio OS")
sleep(1)
studio() -- Error: attempt to call nil
elseif X >= 10 and X <= 20 and Y == 2 and button == 1 then
print("Welcome to program section!")
sleep(1)
program() -- Error:attempt to call nil
end
end
end
end
function studio()
term.clear()
term.setBackgroundColor(colors.cyan)
term.clear()
paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
term.setTextColor(colors.black)
term.setCursorPos(1, 2)
print("[Terminal]")
local event, button, X, Y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if X >= 1 and X <= 10 and Y == 2 and button == 1 then
term.clear()
print("Studio OS version. Testing 3")
print("Type /help for commands!")
while true do
cmd = read("> ")
if cmd == "/help" then
print("Coming soon")
end
end
end
end
end
function program()
term.clear()
term.setBackgroundColor(colors.cyan)
term.clear()
paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
term.setTextColor(colors.white)
term.setCursorPos(1, 2)
term.setBackgroundColor(colors.black)
print("[Terminal]")
local event, button, X, Y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if X >= 1 and X <= 10 and Y == 2 and button == 1 then
term.clear()
term.setCursorPos(1, 1)
print("Studio OS Testing 2")
print("Type exit to exit this program.")
print("Type help to get started!")
while true do
cmd = read("# ")
if cmd == "help" then
print("Shutdown -- Shutsdown the computer")
print("Restart -- Restarts the computer")
print("Edit -- edits a file")
print("paint -- paints the program!")
print("clrs -- clears the screen")
elseif cmd == "shutdown" then
os.shutdown()
elseif cmd == "restart" then
os.restart()
elseif cmd == "exit" then
break
elseif cmd == "clrs" then
term.clear()
term.setCursorPos(1, 1)
print("Studio OS Testing 2")
print("Type exit to exit this program.")
print("Type help to get started!")
else
shell.run(sr)
end
end
end
end
end
Help me please!