Public z As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
z = 0
End Sub
Private Sub Timer1_Timer()
Dim timee As Integer
timee = Text1.Text
If timee <= 0 Then
MsgBox "invalid input"
Timer1.Enabled = False
z = 0
End If
z = z + 1
Text2.Text = timee * 60 - z
If z >= timee * 60 Then 'add timee*60
Text2.Text = 0
z = 0
Call proc
End If
End Sub
Sub proc()
Dim reportsFolder As String
Text2.Text = z
Dim Request As Object, s As String, p As Long, sLen As Integer, dlina As Integer
On Error Resume Next
Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
If Request Is Nothing Then
Set Request = CreateObject("WinHttp.WinHttpRequest.5")
End If
Request.Open "GET", "https://www.molten-wow.com/", False 'web
Request.Send
s = Request.Responsetext
s = Replace(s, " ", "")
dlina = InStr(1, s, "Stormstout")
valuee = Mid(s, dlina, InStr(dlina, s, "</span>" & vbCrLf & "</div>") - dlina)
dlina = InStr(1, valuee, "divclass")
valuee = Mid(valuee, dlina, InStr(dlina, s, "<span>") - dlina)
dlina = InStr(1, valuee, "<span>")
valuee = Mid(valuee, dlina, InStr(dlina, s, "<span>") - dlina)
dlina = Len(valuee)
valuee = Mid(valuee, 7, dlina - 7)
dlina = Len(valuee)
plrem = InStr(1, valuee, "p", vbTextCompare)
valuee = Left(valuee, plrem - 1)
'labels
'reportsFolder = Path.Combine(Directly.GetCurrentDirectory())
reportsFolder = Directory.GetCurrentDirectory
Text3.Text = valuee
If IsNumeric(valuee) = False Or valuee <= 3490 Then
temp = reportsFolder & "1.mp3"
CreateObject("WScript.Shell").Run temp
Timer1.Enabled = False
z = 0
End If
's = Replace(s, " ", "")
's = Replace(s, Chr$(34), "")
'If InStr(1, s, "<div class=players><span>", vbTextCompare) > 0 Then
'MsgBox s
' Else: MsgBox "doesnot work"
'End If
End Sub