
怎么才能讓批處理運行一次然后連續重復運行呢怎么才能讓批處理運行一次,然后連續重復運行呢?下面的這個代碼,運行之后,每發完一個貼就要重復輸入tid才能繼續發帖。所以求連續發帖的代碼。
- @echo off
- title 發帖
- color f2
- cls
- set loopnum=0
- :login
- set /p use=用戶名:
- if %use%== goto login
- set /p pwd=密碼:
- if %pwd%== goto login
- curl -c cookie.txt -d loginfield=username&username=%use%&password=%pwd%&questionid=0&answer=&cookietime=2592000&loginsubmit=true http://www.zxxy8.com/member.php?mod=logging&action=login&loginsubmit=yes&inajax=1>nul
- for /f tokens^=6^ delims^=^;^ %%i in ('curl -b cookie.txt http://www.zxxy8.com/home.php?mod=space&do=pm^|findstr logout') do set formhash=%%i
- cls
- echo 登陸完成(%formhash%),按任意鍵開始發帖 ...
- @pause >nul
- cls
- :post
- set /p tid=帖子TID:
- cls
- setlocal enabledelayedexpansion
- for /f %%i in (postmsg.txt) do (
- set msg=%%i
- timeout /t 3 /nobreak
- curl -b cookie.txt -d message=!msg!&!formhash! http://www.zxxy8.com/forum.php?mod=post&action=reply&tid=!tid!&replysubmit=yes&inajax=1
- )
- goto post
nclick="copycode($('code0'));">復制代碼