os.pullEvent = os.pullEventRaw
shell.run("/Laby/Desktop")
term.setTextColor(colors.white)
term.setBackgroundColor(512)
sleep(0)
term.setCursorPos(1,19)
term.setBackgroundColor(colors.green)
write(" Menu ")
term.setBackgroundColor(colors.blue)
write("                                              ")
term.setBackgroundColor(colors.blue)


function Zeit()
         pzeit = os.time()
	     pzeit = textutils.formatTime(pzeit, true)
	return pzeit	 
end



while true do    
      term.setCursorPos(46,19)
      write(""..Zeit())
	  write(" ")
	  sleep(0.1)
break
end	



sleep(0.1)
term.setCursorPos(1,1)
term.setTextColor(colors.white)
term.setBackgroundColor(colors.blue)
write("                    Downloads                     ")
term.setBackgroundColor(colors.red)
write("X")
term.setBackgroundColor(colors.white)
term.setTextColor(colors.black)
print("                                                   ")
print("            :            :            :            ")
print("------------:------------:------------:------------")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")
print("            :            :            :            ")

term.setTextColor(colors.black)
sleep(0.1)

if fs.exists("/Laby/Downloads/Skype") then
term.setCursorPos(4,2)
print("Skype")
term.setCursorPos(1,4)
print("X Starten")
term.setCursorPos(1,5)
print("X Entfernen")
term.setCursorPos(1,7)
print("X Icon")
else
end



if fs.exists("/Laby/Downloads/Word") then
term.setCursorPos(16,2)
print("LabyWord")
term.setCursorPos(14,4)
print("X Starten")
term.setCursorPos(14,5)
print("X Entfernen")
term.setCursorPos(14,7)
print("X Icon")
else
end

if fs.exists("/Laby/Downloads/calc") then
term.setCursorPos(29,2)
print("Rechner")
term.setCursorPos(27,4)
print("X Starten")
term.setCursorPos(27,5)
print("X Entfernen")
term.setCursorPos(27,7)
print("X Icon")
else
end















while true do
local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y

if XY == "2,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "3,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "4,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "5,19" and button == 1 then
shell.run("/Laby/start")
break
end


if XY == "51,1" and button == 1 then
term.setTextColor(colors.white)
shell.run("/Laby/Gast")
break
end



if XY == "1,4" and button == 1 and fs.exists("/Laby/Downloads/Skype") then
term.setTextColor(colors.black)
shell.run("Laby/Downloads/Skype")
break
end


if XY == "1,7" and button == 1 and fs.exists("/Laby/Downloads/Skype") then
term.setTextColor(colors.black)

if fs.exists("/Laby/Icon/Skype") then
fs.delete("/Laby/Icon/Skype") end
fs.copy("/Laby/Downloads/Skype", "/Laby/Icon/Skype")
sleep(0.1)
shell.run("Laby/Gast")
break
end




if XY == "1,5" and button == 1 and fs.exists("/Laby/Downloads/Skype") then
term.setTextColor(colors.white)
fs.delete("/Laby/Downloads/Skype")
if fs.exists("/Laby/Icon/Skype") then
fs.delete("/Laby/Icon/Skype") end
sleep(0.1)
shell.run("/Laby/Download")
break
end











if XY == "14,4" and button == 1 and fs.exists("/Laby/Downloads/Word") then
term.setTextColor(colors.black)
shell.run("Laby/Downloads/Word")
break
end


if XY == "14,7" and button == 1 and fs.exists("/Laby/Downloads/Word") then
term.setTextColor(colors.black)

if fs.exists("/Laby/Icon/Word") then
fs.delete("/Laby/Icon/Word") end
fs.copy("/Laby/Downloads/Word", "/Laby/Icon/Word")
sleep(0.1)
shell.run("Laby/Gast")
break
end




if XY == "14,5" and button == 1 and fs.exists("/Laby/Downloads/Word") then
term.setTextColor(colors.white)
fs.delete("/Laby/Downloads/Word")
if fs.exists("/Laby/Icon/Word") then
fs.delete("/Laby/Icon/Word") end
sleep(0.1)
shell.run("/Laby/Download")
break
end





















if XY == "27,4" and button == 1 and fs.exists("/Laby/Downloads/calc") then
term.setTextColor(colors.black)
shell.run("Laby/Downloads/calc")
break
end


if XY == "27,7" and button == 1 and fs.exists("/Laby/Downloads/calc") then
term.setTextColor(colors.black)

if fs.exists("/Laby/Icon/calc") then
fs.delete("/Laby/Icon/calc") end
fs.copy("/Laby/Downloads/calc", "/Laby/Icon/calc")
sleep(0.1)
shell.run("Laby/Gast")
break
end




if XY == "27,5" and button == 1 and fs.exists("/Laby/Downloads/calc") then
term.setTextColor(colors.white)
fs.delete("/Laby/Downloads/calc")
if fs.exists("/Laby/Icon/calc") then
fs.delete("/Laby/Icon/calc") end
sleep(0.1)
shell.run("/Laby/Download")
break
end















end