Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- color 1
- title Happy Valentines Day
- goto reg
- ::: This is for the first time being opened
- :reg
- set "regfile=%cd%\reg.txt"
- if exist "%regfile%" goto home
- :: First time opened message
- cls
- echo Hey, this appears the first time you open this up, so press any button to start, or you can close now and wait a bit.
- echo.
- echo (You can reopen it later if you want later)
- echo Also, there is alot of text, I tried to space it out, but you will want to make this tab bigger to read it better, you can also highlight it if you need
- echo.
- pause
- cls
- ::: Message
- echo It's Me
- pause
- echo opened>"%regfile%"
- cls
- ::: Menu
- :home
- cls
- echo.
- echo ---------------------------
- echo Menu
- echo ---------------------------
- echo.
- echo.
- echo 1. Random Message
- echo 2. Replay
- echo.
- choice /c:12 /M "Please choose an action: "
- echo.
- if %errorlevel%==1 call :note
- if %errorlevel%==2 call :rep
- ::: Random line grabber
- :note
- cls
- REM This is where the notes are
- SET "TextFile=list.txt"
- REM Determine the number of lines
- FOR /f %%a IN ('type "%textfile%"^|find /c /v ""') DO SET /a numlines=%%a
- REM Pick a random line
- SET /A RandomLine=(%RANDOM% %% %NumLines%)
- REM Prevent skipping all the lines
- IF "%RandomLine%"=="0" (SET "RandomLine=") ELSE (SET "RandomLine=skip=%randomline%")
- REM Print the random line
- FOR /F "usebackq tokens=* %RandomLine% delims=" %%A IN (`TYPE %TextFile%`) DO (
- echo.
- ECHO %%A
- echo.
- GOTO sub
- )
- :sub
- echo Would you like another(1), or go back (2)
- choice /c:12 /M "Please choose an action: "
- if %errorlevel%==1 call :note
- if %errorlevel%==2 call :home
- :end
- close
- :rep
- del reg.txt
- goto reg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement