BBS灌水机脚本
转载'**********************************************************************
'* Filename: water.vbs *
'* Author: Pred yecha@freecity.cn*
'* You may freely modify or redistribute this file *
'**********************************************************************
'
'注意,使用本脚本时,在脚本相同目录下创建一个文件名为Filename的文件,
'脚本把Filename每行内容依次作为文章标题发表在bbs上
'必须先登录到bbs并经如要post的那个板
'
Filename = "water_title.txt"
'Option Explicit
Main
MsgBox ("Script End")
Sub Main()
Const nTimeout = 20
Const ForReading = 1
Dim bConnect, nTime, nScreenHeight, strScreenLine, nDelay
Dim fso, f1, f2, ts, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(Filename, ForReading)
'b为一个文本文件,脚本把b.txt每行内容依次作为文章标题发表在bbs上
While(Not ts.AtEndOfStream)
s = ts.ReadLine()
s = TrimAll(s)
If s <> "" Then
If ( Not Expect("离开", 1, 10)) Then
'判断屏幕第2行是否有"离开",主要用来判断当前是否在文章列表中
'Error?
Exit Sub
End If
STermScript.SendConvertedData ("^P") '发表文章
STermScript.Delay 200 '短暂延时
If (Not ExpectCursor("标题:", 10)) Then
'当前光标处是填写标题的地方?
'Error?
MsgBox("error?")
Exit Sub
End If
STermScript.SendData (s) '填入标题
STermScript.SendConvertedData ("^M^M") '送出回车
STermScript.Delay 200
STermScript.SendConvertedData ("^W") '结束文章编辑
STermScript.Delay 200
If (Not ExpectCursor("(S)转信", 10)) Then
'出现选择菜单"(S)转信, (F)换行发出,(L)不转信, (A)取消,……"?
'Error?
STermScript.SendConvertedData ("^[^[$$") '出现错误,设法回到版面列表状态
Else
STermScript.SendConvertedData ("^M") '正常,送出回车
End If
STermScript.Delay 20000 '发文时间间隔
End If
Wend
ts.Close
End Sub
'************************************************************
'* Function: TrimAll(strIn) *
'* Return Value: *
'* 除去字符串中所有可能的空格,tab等 *
'************************************************************
Function TrimAll(strIn)
Dim s,c, i
s = Trim(strIn)
TrimAll = ""
for i = 1 to Len(s)
c = Mid(s, i, 1)
If (Asc(c) = 9) Then
Else
TrimAll = TrimAll + c
End if
Next
End Function
'************************************************************
'* Function: ExpectCursor(ByRef str, ByVal TimeOut) *
'* Return Value: True 出现 False 未出现 *
'* 判断在一定时间内,光标所在行是否出现指定字符串 *
'************************************************************
Function ExpectCursor(ByRef str, ByVal TimeOut)
Dim starttime
starttime = Timer
While (Not InStr(STermScript.GetBuffer(STermScript.GetCursorY()), str) > 0)
STermScript.Delay (200)
If (Abs(Timer - starttime) > TimeOut) Then
ExpectCursor = False
' MsgBox (str + " not found, timeout")
Exit Function
End If
Wend
ExpectCursor = True
End Function
'************************************************************
'* Function: Expect(ByRef str, ByVal l, ByVal TimeOut) *
'* Return Value: True 出现 False 未出现 *
'* 判断在一定时间内,指定行是否出现指定字符串 *
'************************************************************
Function Expect(ByRef str, ByVal linenum, ByVal TimeOut)
Dim starttime
starttime = Timer
While (Not InStr(STermScript.GetBuffer(linenum), str) > 0)
STermScript.Delay (200)
If (Abs(Timer - starttime) > TimeOut) Then
Expect = False
' MsgBox (str + " not found, timeout")
Exit Function
End If
Wend
Expect = True
End Function
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Sqlmap tamper 脚本整理
一、说明SQLMAP是一个用于测试SQL注入问题的强大工具,工具有很多可用的选项,使用sqlmap -hh可以看到具体的说明,其可用的选项进行了分类,包括Target、Request、Optimization、Injection、Detection、Techniques、Fingerprint、Enumeration、Brute force、User-deficed function inject
sqlmap tamper base64encode charunicodeencode randomcomments -
关于灌水
职业论坛的70多天,我是在水贴中度过的。
职场 IT 管理 运维 休闲 -
【NOIP模拟】灌水
DescriptionSolution一看还以为好难得样子,但是实际上这不就是暴力吗。 把
NOIP 灌水 暴搜 缩点 几何 -
BBS论坛
我要用JAVA做一个BBS论坛,有谁会啊?帮帮忙啊,谢谢
JAVA 职场 论坛 休闲 -
【BZOJ 1601】 灌水
【题目链接】 https://www.lydsy.com/JudgeOnline/problem.php?id=1601 【算法】 最小生成树 【代码】
i++ php c++ 最小生成树 #include