It's because of the if block within the second os.pullEvent()
As you can see that both the if and elseif have the same condition so the first one will always trigger.
if x1 > (x+1) and x1 < (x+13) then
if y1 == (y+2) then
tB(colors.lightGray)
term.clear()
print("Choosen Stop")
sleep(3)
running = false
end
elseif x1 > (x+1) and x1 < (x+13) then
if y1 == (y+3) then
tB(colors.lightGray)
term.clear()
print("Choosen Settings")
sleep(3)
term.setCursorPos(1,1)
running = false
shell.run("edit [email protected]")
running = true
tB(colors.lightGray)
term.clear()
term.setCursorPos(1,1)
print("Settings Saved.")
sleep(2)
end
end
This works:
if x1 > (x+1) and x1 < (x+13) and y1 == y+2 then
tB(colors.lightGray)
term.clear()
print("Choosen Stop")
sleep(3)
running = false
elseif x1 > (x+1) and x1 < (x+13) and y1 == y+3 then
tB(colors.lightGray)
term.clear()
print("Choosen Settings")
sleep(3)
term.setCursorPos(1,1)
running = false
shell.run("edit [email protected]")
running = true
tB(colors.lightGray)
term.clear()
term.setCursorPos(1,1)
print("Settings Saved.")
sleep(2)
end