Advertisement
Guest User

Rewards and Punishments

a guest
Nov 28th, 2014
1,767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. set /P bead=What color bead was selected?
  4. set "file=c:\bdsm\%bead%.txt"
  5. for /f %%N in ('findstr "." "%file%"^|find /c /v ""') do set lines=%%N
  6. set /a "iterations=1"
  7. for /l %%N in (1 1 %iterations%) do call :printRandomLine
  8. exit /b
  9.  
  10. :printRandomLine
  11. set /a "skip=%random% %% %lines%"
  12. if %skip% lss 1 (set "skip=") else set "skip=skip^=%skip%"
  13. for /f usebackq^ %skip%^ delims^=^ eol^= %%A in ("%file%") do (
  14. echo %%A
  15. pause
  16. exit /b
  17. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement