Can you quote yourself where you say all the ends are in the program? And maybe you should give us some info? I recon "This code isn't working right" is not enough. Also, post full code. Can't stress that enough. We need full code to help you.
--Vars
ver = "0.0.1"
function drawDesktopBackground(x, y)
desktopBackground = paintutils.loadImage("//.sys/background")
paintutils.drawImage(desktopBackground, x, y)
end
totalTicks = 0 --Resets tick counter
--Main loop
while true do
totalTicks = totalTicks + 1 --Tick counter
term.setBackgroundColor(colors.white)
term.clear()
drawDesktopBackground(13, 2) --Draws desktop background
paintutils.drawLine(1, 1, 99, 1, colors.gray) --Draws menu bar
term.setTextColor(colors.black)
term.setCursorPos(1, 1)
print("[Menu] Total Ticks:", totalTicks) --Draws menu button and tick counter
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if x == 1 or x == 2 or x == 3 or x == 4 or x == 5 or x == 6 then
if y == 1 then
paintutils.drawLine(1, 1, 6, 1, colors.lightGray)
paintutils.drawLine(1, 2, 8, 2, colors.lightGray)
paintutils.drawLine(1, 3, 8, 3, colors.lightGray)
paintutils.drawLine(1, 4, 8, 4, colors.lightGray)
term.setCursorPos(1, 1)
print("[Menu]")
print("Programs")
print("Settings")
print("Run")
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if x == 1 or x == 2 or x == 3 or x == 4 or x == 5 or x == 6 or x == 7 or x == 8 then
if y == 2 then --Programs
term.setBackgroundColor(colors.white)
term.clear()
paintutils.drawLine(1, 1, 99, 1, colors.gray)
term.setTextColor(colors.black)
term.setCursorPos(1, 1)
print("[Close] Total Ticks:", totalTicks)
paintutils.drawLine(17, 10, 24, 10, colors.white)
term.setCursorPos(17, 10)
print("Nothing to display")
while true do
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if x == 1 or x == 2 or x == 3 or x == 4 or x == 5 or x == 6 or x == 7 then
if y == 1 then
break
else
if y == 3 then --Settings
print("TEST")
sleep(3)
else
if y == 4 then --Run
term.setBackgroundColor(colors.white)
term.clear()
paintutils.drawLine(1, 1, 99, 1, colors.gray)
term.setTextColor(colors.black)
term.setCursorPos(1, 1)
print(" Total Ticks:", totalTicks)
paintutils.drawLine(17, 10, 24, 10, colors.white)
term.setCursorPos(17, 10)
write("Run: ")
runcmd = read()
shell.run(runcmd)
end
end
end
end
end
end end
end end
end
end
end
end
And why don't you use "elseif's" instead?
I said I tried that.