Posted 19 September 2013 - 09:01 AM
Here`s my code;
term.clear()
os.loadAPI("Apis/DesignUtil")
DesignUtil.setDesign("whiteLightGray")
os.loadAPI("Apis/windowSystem")
local backGround,topBar=DesignUtil.getDesign()
local window=windowSystem.createWindow("System setup",2,2,48,16,false)
local slide=0
local U = nil
local P=nil;
local setupTexts=
{
s0="Please Enter your OSOne ID, or leave fields ";
s01="blank."
}
function registerClick(xPos,yPos)
if slide==0 then
if xPos >= createIDButton.x and xPos <= createIDButton.x + createIDButton.W - 1 and yPos >= createIDButton.y and yPos <= createIDButton.y + createIDButton.H then
os.reboot()
end
end
end
function verifyData(Un,Pn)
if not Un and not Pn then
slide=1
end
end
while true do
term.setTextColor(colors.lightGray);
paintutils.drawImage(backGround,1,1)
if slide==1 then
end
if slide==0 then
term.setCursorPos(4,4)
term.setTextColor(colors.gray);
print(setupTexts.s0)
term.setCursorPos(4,5)
print(setupTexts.s01)
term.setTextColor(colors.lightGray);
end
windowSystem.drawWindow(window)
term.setBackgroundColor(colors.white)
if slide==0 then
--button
term.setBackgroundColor(colors.gray)
term.setCursorPos(38,6)
print(" ")
term.setCursorPos(20,6)
term.setBackgroundColor(colors.white)
print("OSOne ID Username: ")
term.setCursorPos(38,6)
term.setBackgroundColor(colors.gray)
term.setTextColor(colors.lightGray);
U=read()
term.setBackgroundColor(colors.white)
term.setTextColor(colors.gray);
term.setCursorPos(20,7)
print("OSOne ID Password: ")
term.setBackgroundColor(colors.gray)
term.setCursorPos(38,7)
print(" ")
term.setCursorPos(38,7)
term.setTextColor(colors.lightGray);
P=read("*")
verifyData(U,P)
term.setBackgroundColor(colors.white)
end
sleep(0.15)
end
as you can see, if tha two fields have been Entered, it is supposed to run verifyData, it doesnt, verifyData does not set slide to 1, as that would clear the screen from the text but the screen stays the same. How can I make that work?