Set http = CreateObject("Msxml2.XMLHTTP")
Set regex = New RegExp
regex.IgnoreCase = True
regex.MultiLine = True
If login Then
Randomize
Scores = getScore
MsgBox "当前积分: " & Scores(0),64+4096,"提示"
For i = 0 To 2
If InStr(getChrist,"602") Then
MsgBox "已经领取过了!",48+4096,"失败"
WScript.Quit
End If
Next
Scores1 = getScore
MsgBox "领取完毕!" & vbCrLf & vbCrLf & _
"当前积分: " & Scores1(0) & " ,增加了: " & Scores1(0) - Scores(0) & vbCrLf & vbCrLf & _
"还差 " & Scores1(1) & " 分,升到 " & Scores1(2) & " 级。",64+4096,"成功"
Else
MsgBox "登录失败!",16+4096,"失败"
End If
Function login() '登录
http.open "POST", "http://kzone.kuwo.cn/mlog/st/LoginBox", False
http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.send "username=" & user & "&password=" & pass & "&useCookie=1"
wml = http.responseText
login = InStr(wml, "登录成功")
End Function
Function getChrist() '听歌赚积分,每日3次
http.open "GET", "http://kzone.kuwo.cn/mlog/getChrist?_=" & Rnd, False
http.send
getChrist = http.responseText
End Function
Function getScore() '读取积分
http.open "GET", "http://mboxspace.kuwo.cn/ucm/st/userScore?_=" & Rnd, False
http.send
html = http.responseText
regex.Pattern="score':'(\d+)"
If regex.Test(html) Then score = regex.Execute(html).Item(0).Submatches(0)
regex.Pattern="scoreToNext':'(\d+)"
If regex.Test(html) Then scoreToNext = regex.Execute(html).Item(0).Submatches(0)
regex.Pattern="nextLevel':'(\d+)"
If regex.Test(html) Then nextLevel = regex.Execute(html).Item(0).Submatches(0)
getScore = Array(score,scoreToNext,nextLevel)
End Function