Step 2: Responses to Different Inputs

The following lines tell the program what to do with the program when an input is entered.



:middle      "reference point"
set /a counter+=1      "sets counter to itself plus one"
if %counter%==5 goto BAD      "if counter is five (password is wrong five times) go to bad"
if NOT %counter%==5 goto OK      "if counter is not five go to bad"
:OK       "reference point"
color 4      "makes the color black and red"
cls      "clears the screen"
echo The Unlock Code you entered is incorrect.      "display'
echo.      "display an empty line'
echo Please enter the code again or buzz of and ask %username%!!! >:D      "display'
echo.      "display an empty line'
ping localhost -n 4 >nul       "pings the computer without showing it to pause the program"
goto start121      "go to start121 reference point"
:BAD      "reference point"
cls      "clears the screen"
color 7      "sets the color to black and white"
echo You have been continuesly incorrect.      "display"
ping loaclhost -n 4 >nul      "waits"
:START      "reference point"
set TIMER=4      "timer (variable) is 4"
set SECONDS=60      "seconds (variable) is 60"
:START1      "reference point"
color 7      "makes the color black and white"
cls      "clears"
echo You must wait %TIMER%.%SECONDS% minutes      "enters a timer made from the two variables made before"
set /a SECONDS=SECONDS-1      "Seconds now is itself minus one"
if %SECONDS%==0 goto SET      "if seconds is zero go to set"
ping localhost -n 2 >nul      "waits"
goto START1      "go to a reference point (start1)"
:SET      "reference point"
if %TIMER% ==0 goto COUNTERSET
set /a TIMER=TIMER-1      "timer is now timer minus one"
set SECONDS=60      "seconds equals 60"
goto START1      "go to start1 (reference point)
:unlock      "reference"
cls       "clear"
echo please wait...      "display"
ping localhost -n 2 >nul      "waits"
color 2      "makes the color black and green"
"the following creates a loading bar effect"
cls 
echo [1    ]
ping localhost -n 1 >nul
cls
echo [11   ]
ping localhost -n 1 >nul
cls
echo [111  ]
ping localhost -n 1 >nul
cls
echo [ 111 ]
ping localhost -n 1 >nul
cls
echo [  111]
ping localhost -n 1 >nul
cls
echo [   11]
ping localhost -n 1 >nul
cls
echo [    1]
ping localhost -n 1 >nul
cls
echo [1    ]
ping localhost -n 1 >nul
cls
echo [11   ]
ping localhost -n 1 >nul
cls
echo [111  ]
ping localhost -n 1 >nul
cls
echo [ 111 ]
ping localhost -n 1 >nul
cls
echo [  111]
ping localhost -n 1 >nul
cls
echo [   11]
ping localhost -n 1 >nul
cls
echo [    1]
ping localhost -n 1 >nul
cls
echo [1    ]
ping localhost -n 1 >nul
cls
echo [11   ]
ping localhost -n 1 >nul
cls
echo [111  ]
ping localhost -n 1 >nul
cls
echo [ 111 ]
ping localhost -n 1 >nul
cls
echo [  111]
ping localhost -n 1 >nul
cls
echo [   11]
ping localhost -n 1 >nul
cls
echo [    1]
ping localhost -n 1 >nul
cls
echo [1    ]
ping localhost -n 1 >nul
cls
start explorer.exe
echo [11   ]
ping localhost -n 1 >nul
cls
echo [111  ]
ping localhost -n 1 >nul
cls
echo [ 111 ]
ping localhost -n 1 >nul
cls
echo [  111]
ping localhost -n 1 >nul
cls
echo [   11]
ping localhost -n 1 >nul
cls
echo [    1]
ping localhost -n 1 >nul
cls
goto end      "go to end"

 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!