Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.83 KB | None | 0 0
  1. @echo off
  2. title Chat-Auto
  3. setlocal enabledelayedexpansion
  4.  
  5. for /f "tokens=*" %%a in ('find /v /c "" ^< "console.log"') do set /a nb=%%a
  6. set /a delMsg=!nb!-31
  7. set /a nbLine=0
  8. if exist "consoleLimit.log" del /q "consoleLimit.log"
  9. for /f "tokens=*" %%b in ('type "console.log"') do set /a nbLine+=1 & if !nbLine! GTR !delMsg! echo;%%b >> "consoleLimit.log"
  10.  
  11. :loop
  12. if exist ok del /q ok&call :Limit 40
  13. goto :loop
  14.  
  15.  
  16.  
  17.  
  18.  
  19. :Limit
  20. set /a ListMsg=%~1-2
  21. mode con lines=%~1 cols=150
  22. for /f "tokens=*" %%a in ('find /v /c "" ^< "consoleLimit.log"') do set /a nb=%%a
  23. set /a delMsg=!nb!-31
  24. set /a nbLine=0
  25. for /f "tokens=*" %%b in ('type "consoleLimit.log"') do (
  26.   if "!nbLine!"=="0" del /q "consoleLimit.log"
  27.   set /a nbLine+=1 & if !nbLine! GTR !delMsg! echo;%%b >> "consoleLimit.log"
  28. )
  29. type consoleLimit.log
  30. goto :eof
  31.  
  32. pause>nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement