本帖最后由 老刘1号 于 2017-7-20 18:08 编辑
新版:
1、递归优化为循环,优化算法。
2、强大的错误处理,服务器挂掉了都还会运行等待恢复。
3、开始检测tokens的值的变化。
其它:
为防止利用,做了简单加密(使用乱码兄的加密代码)~
决定开源,代码无法运行,需要改UA
不过算法是完整的
VBS- Const [宿主] = "CSCRIPT.EXE" 'WSCRIPT
- If Not UCase(Right(WScript.FullName,11)) = UCase([宿主]) Then
- Dim Args,Arg
- For Each Arg in Wscript.Arguments
- Args=Args&Chr(&H20)&Chr(&H22)&Arg&Chr(&H22)
- Next
- CreateObject("Wscript.Shell").Run _
- [宿主]&Chr(&H20)&Chr(&H22)&WScript.ScriptFullName&Chr(&H22)&Args
- WScript.Quit
- End If
- on error resume next
-
- If MsgBox("是否查看原贴?",1) = 1 Then CreateObject("Wscript.Shell").run "http://www.bathome.net/thread-44616-1-1.html"
-
- With CreateObject("MSXML2.XMLHTTP")
- .Open "POST", "http://bbaass.tk/math/", False
- .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
- .Send "send=reg&username=老刘"
- End With
- dim tokens,[大鱼小鱼或等鱼?],[Arr返回的数据]
-
- High = 10001
- Low = -1
- Do
- Do
- Mid_=(High+Low)\2
- [Arr返回的数据] = Math(Mid_)
- [大鱼小鱼或等鱼?] = [Arr返回的数据](0)
- if tokens<>[Arr返回的数据](1) then
- If [大鱼小鱼或等鱼?] = "=" then
- wscript.echo "Win!The number is "&Mid_
- Else
- Wscript.echo "Tokens is change"
- End if
- tokens=[Arr返回的数据](1)
- High = 10001
- Low = -1
- Exit do
- Else
- Select Case [大鱼小鱼或等鱼?]
- Case ">"
- WScript.Echo ">,so try "&Low&","&Mid_
- High = Mid_
- Case "<"
- WScript.Echo "<,so try "&Mid_&","&High
- Low = Mid_
- End Select
- End if
- Loop
- Loop
-
- Function Math(num)
- dim [返回数据]
- With CreateObject("MSXML2.XMLHTTP")
- .Open "POST","http://bbaass.tk/math/", False
- .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
- .send "send=Answer&math=" & num & "&username=老刘"
- [返回数据] = .responseText
- Math = Split(Split(Split([返回数据],",")(2),"""")(3) & " "&Split([返回数据],"""")(13)," ")
- End With
- End Function
复制代码
|