It is currently Thu Sep 09, 2010 8:24 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: UI LoginScreen (w/tabbing)
PostPosted: Sun Feb 28, 2010 12:55 pm 
User avatar

Joined: Thu Mar 27, 2008 8:51 pm
Posts: 395
Location: Hertfordshire, United Kingdom
Just set the $User and $Pass at the top of the script to what you want and you are ready to go...

Details:
Use Right arrow to change options (DSO disables reading of Tab key).
All outlining/graphics has been kept to a minimal, colour can be added at a loss of refresh rate.
Only allows input of Letters, Numbers and Spaces in both Username and Password.
Highlight OK and Cancel buttons, press Enter to "Click".
Set the Login code in the GOTO at the bottom called @CorrectUser.

Code:
|YDIV 0
$User = "TestUser"
$Pass = "TestPass"

$TabStop = 0
$UnSelectedStyle = "12,LUCIDA CONSOLE"
$SelectedStyle = "RED,12,LUCIDA CONSOLE"

$UserTabStop = 0
$PassTabStop = 1
$OKTabStop = 2
$CancelTabStop = 3

$UserBlank = 1
$PassBlank = 1

$UserInput = "_"
$PassInput = ""
$PassDisplay = "_"
$txtUser = CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)     
$txtPass = CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)
$Background = CHR(10)     ##########################CHR(10)     #                        #CHR(10)     #  ###############       #CHR(10)     #  #Username     #       #CHR(10)     #  #             #       #CHR(10)     #  ###############       #CHR(10)     #                        #CHR(10)     #  ###############       #CHR(10)     #  #Password     #       #CHR(10)     #  #             #       #CHR(10)     #  ###############       #CHR(10)     #                        #CHR(10)     # ##########  ########## #CHR(10)     # #        #  #        # #CHR(10)     # ##########  ########## #CHR(10)     #                        #CHR(10)     ##########################CHR(10)
$btnOK = CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)           OK
$btnCancel = CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)CHR(10)                     CANCEL

$ValidKeys = ".32.48.49.50.51.52.53.54.55.56.57.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90."

GOTO Display

@TabChange
$TabStop = $TabStop + 1
IF $TabStop > 3
   $TabStop = 0
ENDIF
GOTO Display

@Input
$Key = GETKEY()
IF $Key = 39
   GOTO TabChange
ELSEIF $Key = 13
   IF $TabStop = 2
      GOTO OK
   ELSEIF $TabStop = 3
      GOTO Cancel
   ENDIF
ELSEIF $Key = 8
   IF $TabStop = 0   
      $LEN = LEN($UserInput) - 1
      IF $LEN > 0
         $UserInput = LEFT($UserInput,$LEN)
      ELSEIF $LEN = 0
         $UserBlank = 1
         $UserInput = "_"
      ENDIF
   ELSEIF $TabStop = 1
      $LEN = LEN($PassInput) - 1
      IF $LEN > 0
         $PassInput = LEFT($PassInput,$LEN)
         $PassDisplay = LEFT($PassDisplay,$LEN)
      ELSEIF $LEN = 0
         $PassBlank = 1
         $PassInput = ""
         $PassDisplay = "_"
      ENDIF
   ENDIF
ELSEIF INSTR("$ValidKeys",".$Key.") > 0
   IF $TabStop = 0
      IF $UserBlank = 1
         $UserBlank = 0
         $UserInput = ""
      ENDIF
      $UserInput = $UserInputCHR($Key)
   ELSEIF $TabStop = 1
      IF $PassBlank = 1
         $PassBlank = 0
         $PassDisplay = ""
      ENDIF
      $PassInput = $PassInputCHR($Key)
      $PassDisplay = $PassDisplay*
   ENDIF
ELSE
   GOTO Input
ENDIF

@Display
$DisplayData = ""
IF $TabStop = 0
   $DisplayData = $DisplayData$txtUser           $UserInput{RED,12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$txtPass           $PassDisplay{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnOK{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnCancel{12,LUCIDA CONSOLE}$newline
ELSEIF $TabStop = 1
   $DisplayData = $DisplayData$txtUser           $UserInput{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$txtPass           $PassDisplay{RED,12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnOK{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnCancel{12,LUCIDA CONSOLE}$newline
ELSEIF $TabStop = 2
   $DisplayData = $DisplayData$txtUser           $UserInput{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$txtPass           $PassDisplay{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnOK{RED,12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnCancel{12,LUCIDA CONSOLE}$newline
ELSEIF $TabStop = 3
   $DisplayData = $DisplayData$txtUser           $UserInput{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$txtPass           $PassDisplay{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnOK{12,LUCIDA CONSOLE}$newline
   $DisplayData = $DisplayData$btnCancel{RED,12,LUCIDA CONSOLE}$newline
ENDIF
$DisplayData = $DisplayData$Background{12,LUCIDA CONSOLE}$newline
$DisplayData = $DisplayData{100}$newline
$DisplayData = $DisplayData{100}
CLEAR
SAYALL $DisplayData
GOTO Input

@OK
IF $UserInput = $User
   IF $PassInput = $Pass
      GOTO CorrectUser
   ELSE
      GOTO IncorrectUser
   ENDIF
ELSE
   GOTO IncorrectUser
ENDIF

@Cancel
CLEAR
SAY Not Logged In
EXIT

@CorrectUser
CLEAR
SAY Logged In
EXIT

@IncorrectUser
CLEAR
SAY Incorrect Username or Password
PAUSE
GOTO Display

_________________
DSO - More than just a hacking simulator!

Mess with the best, Die like the rest!


Offline
 Profile  
 
 Post subject: Re: UI LoginScreen (w/tabbing)
PostPosted: Sun Feb 28, 2010 1:52 pm 
User avatar

Joined: Mon Feb 16, 2009 4:52 pm
Posts: 236
Location: Node Outpost
Quote:
Only allows input of Letters, Numbers and Spaces in both Username and Password.


Symbols add security to passwords, it really should allow the input of symbols.

_________________
/ Skynet-OS Developer / Mission Developer / SafeDSO collaborator / Forum Global Moderator /
Image


Offline
 Profile  
 
 Post subject: Re: UI LoginScreen (w/tabbing)
PostPosted: Sun Feb 28, 2010 2:22 pm 
User avatar

Joined: Thu Mar 27, 2008 8:51 pm
Posts: 395
Location: Hertfordshire, United Kingdom
Hmm yeh ok, i'll make those changes

_________________
DSO - More than just a hacking simulator!

Mess with the best, Die like the rest!


Offline
 Profile  
 
 Post subject: Re: UI LoginScreen (w/tabbing)
PostPosted: Sun Feb 28, 2010 2:31 pm 
User avatar

Joined: Thu Mar 27, 2008 8:51 pm
Posts: 395
Location: Hertfordshire, United Kingdom
Update:
DisplayData is now changed for refresh rate efficiency and password field now displays in '*'

_________________
DSO - More than just a hacking simulator!

Mess with the best, Die like the rest!


Offline
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron