怎么用VBS脚本自动注册yy娱乐的账号

set WshShell=WScript.CreateObject("WScript.Shell")
Const user = "hugetech2"
Const pwd = "huge204204"
Const pid = ""
Const mobilePwd = "basketball123"
Dim userToken
Dim mobile
Dim identify
identify = ""
'登陆api网站,获取用户token
function getUserToken()
Dim ie2
Set ie2 = CreateObject("InternetExplorer.Application")
ie2.navigate "http://api.jmyzm.com/http.do?action=loginIn&uid="&user&"&pwd="&pwd
Wscript.sleep
userReturn = ie2.document.getElementsByTagName("body")().innerHTML
userReturnArray = split(userReturn, "|")
userToken = userReturnArray()
'msgbox userToken
end function '获取手机号
function getMobile()
Dim ie3
Set ie3 = CreateObject("InternetExplorer.Application")
ie3.navigate "http://api.jmyzm.com/http.do?action=getMobilenum&pid="&pid&"&uid="&user&"&token="&userToken
Wscript.sleep
mobileReturn = ie3.document.getElementsByTagName("body")().innerHTML
mobileReturnArray = split(mobileReturn, "|")
mobile = mobileReturnArray()
'msgbox mobile
end function '获取验证码
function getIdentify()
Dim ie4,flag
Set ie4 = CreateObject("InternetExplorer.Application")
ie4.navigate "http://api.jmyzm.com/http.do?action=getVcodeAndReleaseMobile&uid="&user&"&token="&userToken&"&mobile="&mobile
Wscript.sleep
identifyReturn = ie4.document.getElementsByTagName("body")().innerHTML
identifyReturnArray = split(identifyReturn, "|")
flag =
do while flag<
if identifyReturnArray() = mobile Then
identifyAll = identifyReturnArray()
if Mid(identifyAll,,) = "验证码" Then
identify = Mid(identifyAll,,)
else
identify = Mid(identifyAll,,)
end if
exit do
Else
Wscript.sleep
Dim ieTemp
Set ieTemp = CreateObject("InternetExplorer.Application")
ieTemp.navigate "http://api.jmyzm.com/http.do?action=getVcodeAndReleaseMobile&uid="&user&"&token="&userToken&"&mobile="&mobile
Wscript.sleep
identifyReturn =ieTemp.document.getElementsByTagName("body")().innerHTML
identifyReturnArray = split(identifyReturn, "|")
End if
flag = flag+
loop
end function '注册账号第一步:登陆直播间,进入注册界面
function register1()
Dim ie_1
Set ie_1 = CreateObject("InternetExplorer.Application")
ie_1.visible=true
ie_1.navigate "http://m.yy.com/room/14495179/?f=6308"
Wscript.sleep
ie_1.document.getElementById("navRegister").Click
Wscript.sleep
ie_1.document.getElementById("yyRegister").Click
Wscript.sleep
end function '注册账号第二步:填写注册信息,发送短信
function register2()
Dim ie_2
Set ie_2 = CreateObject("InternetExplorer.Application")
ie_2.visible=true
ie_2.navigate "https://aq.yy.com/p/reg/mobile.do?appid=5623&action=2&busiurl=http%3A%2F%2Fm.yy.com%2F%3Ff%3D6308%26cpuid%3D0%26dhz%3D1&fromadv=myy_6308.cpuid_0.channel_14495179&reqDomainList="
Wscript.sleep
ie_2.document.getElementsByTagName("a")().Click
for i= to
Wscript.sleep
WshShell.SendKeys "{Tab}"
next
WshShell.SendKeys mobile
WshShell.SendKeys "{Tab}"
Wscript.sleep
WshShell.SendKeys mobilePwd
WshShell.SendKeys "{Tab}"
Wscript.sleep
WshShell.SendKeys mobilePwd
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Enter}"
Wscript.sleep
getIdentify()
Wscript.sleep
WshShell.SendKeys "^4"
WshShell.SendKeys "{Tab}"
Wscript.sleep
if identify <> "" Then
WshShell.SendKeys identify
Wscript.sleep
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Enter}"
Else
MsgBox "fail to get identify"
End if
end function '关闭浏览器,并且再次启动
function closeWeb()
Set ws = CreateObject("Wscript.Shell")
ws.run "taskkill /f /im 360se.exe",vbhide
Wscript.sleep
ws.run "C:\Users\HugeTech7\Desktop\mytest.vbs"
End Function '开始执行
for i= to
getUserToken
Wscript.sleep
getMobile
Wscript.sleep
register1
register2
msgbox "账号注册成功,账号是:"&mobile&"密码是:"&mobilePwd
Wscript.sleep
closeWeb
next
上一篇:【转】Delphi的消息对话框


下一篇:释放 cached 内存