while true do
local timer = os.startTimer(1)
local event = {os.pullEvent()}
if event[1] == "timer" then
local formattedTime = textutils.formatTime( os.time(), false)
term.setCursorPos(5,5)
print(formattedTime)
elseif event[1] == "mouse_click" then
if event[2] == 1 and event[3] == 48 and event[4] == 17 then
shell.run"clear"
shell.run"dmenu"
end
I cleaned up your code and made a little bit more effective.
Creator
Does not work here is the whole code (i working with a new commands now it is a bit older :D/>)
shell.run"clear"
------------------------------------------------------
Bild = paintutils.loadImage("OS/d1.img")
paintutils.drawImage(Bild,1,1)
------------------------------------------------------
term.setBackgroundColor(colors.lightGray)
term.setTextColor(colors.white)
-----
fg = fs.open("loginSettins/version","r")
farbe = fg.readLine()
farbe = loadstring("return "..farbe)()
fg.close()
------------------------------------------------------
paintutils.drawPixel(49,17, colors.blue)
paintutils.drawPixel(50,18, colors.blue)
paintutils.drawPixel(50,17, colors.blue)
paintutils.drawPixel(49,18, colors.blue)
paintutils.drawPixel(48,17, colors.blue)
paintutils.drawPixel(48,18, colors.blue)
term.setTextColor(colors.gray)
term.setBackgroundColor(colors.white)
term.setCursorPos(1,7)
print("Settings")
term.setCursorPos(2,12)
print(" News")
term.setCursorPos(2,17)
print(" Worm")
term.setCursorPos(11,7)
print("ChromeMenu")
term.setCursorPos(13,12)
print("NPaint")
term.setCursorPos(13,17)
print("XFiles")
term.setTextColor(colors.white)
term.setBackgroundColor(colors.blue)
term.setCursorPos(48,17)
print("")
term.setCursorPos(48,18)
paintutils.drawPixel(3,4,40000)
paintutils.drawPixel(4,4,40000)
paintutils.drawPixel(5,4,40000)
paintutils.drawPixel(6,4,40000)
paintutils.drawPixel(3,5,40000)
paintutils.drawPixel(6,5,40000)
paintutils.drawPixel(3,6,40000)
paintutils.drawPixel(4,6,40000)
paintutils.drawPixel(5,6,40000)
paintutils.drawPixel(6,6,40000)
------------
paintutils.drawPixel(3,9,3000)
paintutils.drawPixel(4,9,3000)
paintutils.drawPixel(5,9,3000)
paintutils.drawPixel(6,9,3000)
paintutils.drawPixel(3,10,3000)
paintutils.drawPixel(6,10,3000)
paintutils.drawPixel(3,11,3000)
paintutils.drawPixel(4,11,3000)
paintutils.drawPixel(5,11,3000)
paintutils.drawPixel(6,11,3000)
---------------
paintutils.drawPixel(3,14,20000)
paintutils.drawPixel(4,14,20000)
paintutils.drawPixel(5,14,20000)
paintutils.drawPixel(6,14,20000)
paintutils.drawPixel(3,15,20000)
paintutils.drawPixel(6,15,20000)
paintutils.drawPixel(3,16,20000)
paintutils.drawPixel(4,16,20000)
paintutils.drawPixel(5,16,20000)
paintutils.drawPixel(6,16,20000)
--------------
paintutils.drawPixel(14,4,33)
paintutils.drawPixel(15,4,33)
paintutils.drawPixel(16,4,33)
paintutils.drawPixel(17,4,33)
paintutils.drawPixel(14,5,33)
paintutils.drawPixel(17,5,33)
paintutils.drawPixel(14,6,33)
paintutils.drawPixel(15,6,33)
paintutils.drawPixel(16,6,33)
paintutils.drawPixel(17,6,33)
-------------------
paintutils.drawPixel(14,9,17)
paintutils.drawPixel(15,9,17)
paintutils.drawPixel(16,9,17)
paintutils.drawPixel(17,9,17)
paintutils.drawPixel(14,10,17)
paintutils.drawPixel(17,10,17)
paintutils.drawPixel(14,11,17)
paintutils.drawPixel(15,11,17)
paintutils.drawPixel(16,11,17)
paintutils.drawPixel(17,11,17)
----------------------
paintutils.drawPixel(14,14,9)
paintutils.drawPixel(15,14,9)
paintutils.drawPixel(16,14,9)
paintutils.drawPixel(17,14,9)
paintutils.drawPixel(14,15,9)
paintutils.drawPixel(17,15,9)
paintutils.drawPixel(14,16,9)
paintutils.drawPixel(15,16,9)
paintutils.drawPixel(16,16,9)
paintutils.drawPixel(17,16,9)
---------------
paintutils.drawLine(1, 1, 51, 1, tonumber(farbe))
------------
term.setTextColor(colors.black)
shell.run"cd //"
file = fs.open("loginSettins/curUser", "r")
version = file.readLine()
file.close()
term.setCursorPos(1,1)
print(version)
shell.run"cd //"
shell.run"cd OS"
local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y
-------------------FORMEL----------------------------------------
while true do
local timer = os.startTimer(1)
local event = {os.pullEvent()}
if event[1] == "timer" then
local formattedTime = textutils.formatTime( os.time(), false)
term.setCursorPos(5,5)
print(formattedTime)
else
if XY == "48,17" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
if XY == "49,17" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
if XY == "50,17" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
if XY == "48,18" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
if XY == "49,18" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
if XY == "50,18" and button == 1 then
shell.run"clear"
shell.run"dmenu"
end
------------------------ICON1 Z1--------------------------------------
if XY == "3,6" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "4,6" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "5,6" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "6,6" and button == 1 then
shell.run"clear"
shell.run"settings"
end
--------------------------------Icon1 Z2-------------------------------
if XY == "3,5" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "4,5" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "5,5" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "6,5" and button == 1 then
shell.run"clear"
shell.run"settings"
end
----------------------------Icon1 Z3---------------------------------
if XY == "3,4" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "4,4" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "5,4" and button == 1 then
shell.run"clear"
shell.run"settings"
end
if XY == "6,4" and button == 1 then
shell.run"clear"
shell.run"settings"
end
-------------------------------------------------------------------------
------------------------Icon 2 z1-----------------------------------------
-----------------------------------------------------------------------------
if XY == "3,11" and button == 1 then
shell.run"e"
break
end
if XY == "4,11" and button == 1 then
shell.run"e"
break
end
if XY == "5,11" and button == 1 then
shell.run"e"
break
end
if XY == "6,11" and button == 1 then
shell.run"e"
break
end
----------------------------------------Icon2 z2----------------------------+
if XY == "3,10" and button == 1 then
shell.run"e"
break
end
if XY == "4,10" and button == 1 then
shell.run"e"
break
end
if XY == "5,10" and button == 1 then
shell.run"e"
break
end
if XY == "6,10" and button == 1 then
shell.run"e"
break
end
--------------------------------------Icon2 z3--------------------------------------
if XY == "3,9" and button == 1 then
shell.run"e"
break
end
if XY == "4,9" and button == 1 then
shell.run"e"
break
end
if XY == "5,9" and button == 1 then
shell.run"e"
break
end
if XY == "6,9" and button == 1 then
shell.run"e"
break
end
------------------------------------------------------------------------------------
-------------------------------------Icon3 Z1---------------------------------------
------------------------------------------------------------------------------------
if XY == "3,16" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "4,16" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "5,16" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "6,16" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
-----------------------------------Icon3 Z2----------------------------------------
if XY == "3,15" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "4,15" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "5,15" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "6,15" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
-------------------------------------Icon3 Z3--------------------------------------
if XY == "3,14" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "4,14" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "5,14" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
if XY == "6,14" and button == 1 then
shell.run"clear"
term.setBackgroundColor(colors.black)
sleep(1)
shell.run"worm"
shell.run"desktop"
break
end
--------------------------------------------------------------------
-------------------------------------------------------------------
if XY == "14,6" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "15,6" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "16,6" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "17,6" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
-----
if XY == "14,5" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "15,5" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "16,5" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "17,5" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
----
if XY == "14,4" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "15,4" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "16,4" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
if XY == "17,4" and button == 1 then
shell.run"clear"
shell.run"chromestore"
break
end
-------------------------------------------
if XY == "14,9" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "15,9" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "16,9" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "17,9" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "14,10" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "15,10" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "16,10" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "17,10" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "14,11" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "15,11" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "16,11" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
if XY == "17,11" and button == 1 then
shell.run"clear"
shell.run"npaint"
shell.run"desktop"
end
----------------------------------------
if XY == "14,15" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "15,15" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "16,15" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "17,15" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "14,16" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "15,16" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "16,16" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "17,16" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "14,14" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "15,14" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "16,14" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
if XY == "17,14" and button == 1 then
shell.run"clear"
shell.run"filebrowser"
shell.run"desktop"
end
end
end
I have to clean this code :D/> :D/>