Here is one part of the event codes :
while true do
local event, X, Y = os.pullEvent("mouse_click")
if X==4 and Y==6 then
login()
break
elseif X==4 and Y==8 then
register()
break
end
end
while true do
local event, X, Y = os.pullEvent("mouse_click")
if X==4 and Y==6 then
login()
break
elseif X==4 and Y==8 then
register()
break
end
end
local event, button, X, Y = os.pullEvent("mouse_click")
os.loadAPI(".sys/API/kernal")
local login = kernal.getTable(".opt/logon/.uacc")
local usr1 = string.sub(login[1], string.find(login[1], ":")+2)
local pass1 = string.sub(login[2], string.find(login[2], ":")+2)
local usr2 = string.sub(login[3], string.find(login[3], ":")+2)
local pass2 = string.sub(login[4], string.find(login[4], ":")+2)
local usr3 = string.sub(login[5], string.find(login[5], ":")+2)
local pass3 = string.sub(login[6], string.find(login[6], ":")+2)
function login()
term.setBackgroundColor(8)
term.clear()
term.setTextColor(1)
paintutils.drawLine(1,1,51,1,colors.blue)
paintutils.drawLine(1,19,51,19,colors.blue)
term.setCursorPos(1,19)
write("© 2016 erik0004")
term.setCursorPos(1,1)
print("OS'16 Login")
term.setBackgroundColor(8)
term.setCursorPos(5,9)
print("Password : ")
term.setCursorPos(5,7)
write("Username : ")
input = read()
if input == usr1 or input == usr2 or input == usr3 then
term.setCursorPos(5,9)
write("Password : ")
input = read("*")
if input == pass1 or input == pass2 or input == pass3 then
term.setCursorPos(7,12)
textutils.slowPrint("Welcome, please wait.")
sleep(0.5)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.1)
term.setCursorPos(5,12)
print([[\]])
sleep(0.1)
term.setCursorPos(5,12)
print([[|]])
sleep(0.1)
term.setCursorPos(5,12)
print([[/]])
sleep(0.1)
term.setCursorPos(5,12)
print([[-]])
sleep(0.2)
term.setCursorPos(5,12)
print([[ ]])
sleep(0.5)
shell.run(".sys/GUI/desktop")
else
term.setCursorPos(5,12)
print("Incorrect Password!")
sleep(3)
shell.run(".sys/logon/usr_login")
end
else
term.setCursorPos(5,12)
print("Incorrect Username!")
sleep(3)
shell.run(".sys/logon/usr_login")
end
end
function register()
term.setBackgroundColor(8)
term.clear()
term.setTextColor(1)
paintutils.drawLine(1,1,51,1,colors.blue)
paintutils.drawLine(1,19,51,19,colors.blue)
term.setCursorPos(1,19)
write("© 2016 erik0004")
term.setCursorPos(1,1)
print("OS'16 Register")
end
function drawLogin()
term.setBackgroundColor(8)
term.clear()
term.setTextColor(1)
paintutils.drawLine(1,1,51,1,colors.blue)
paintutils.drawLine(1,19,51,19,colors.blue)
term.setCursorPos(1,19)
write("© 2016 erik0004")
term.setCursorPos(1,1)
print("OS'16 Login")
term.setBackgroundColor(8)
term.setCursorPos(6,6)
print("Login")
term.setCursorPos(6,8)
print("Register")
term.setTextColor(colors.red)
term.setCursorPos(4,6)
print("X")
term.setCursorPos(4,8)
print("X")
end
drawLogin()
while true do
local event, X, Y, button = os.pullEvent("mouse_click")
if X == 4 and Y == 6 and button == 1 then
login()
break
end
if X == 4 and Y == 8 and button == 1 then
register()
break
end
end
local event, X, Y, button = os.pullEvent("mouse_click")
local event, button, X, Y = os.pullEvent("mouse_click")
local event , X, Y, button = os.pullEvent("mouse_click")
in exactly this order. I don't understand why it is now so