ToExp.frm
资源名称:qq.rar [点击查看]
上传用户:luoweizhao
上传日期:2022-08-01
资源大小:1290k
文件大小:35k
源码类别:
外挂编程
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Begin VB.Form ToExp
- BorderStyle = 1 'Fixed Single
- Caption = "作物刷经验辅助工具"
- ClientHeight = 6465
- ClientLeft = 45
- ClientTop = 435
- ClientWidth = 7830
- Icon = "ToExp.frx":0000
- LinkTopic = "Form8"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6465
- ScaleWidth = 7830
- StartUpPosition = 1 '所有者中心
- Begin VB.Frame Frame3
- Caption = "功能介绍:"
- Height = 5055
- Left = 120
- TabIndex = 27
- Top = 120
- Width = 3735
- Begin VB.TextBox Text4
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 4695
- Left = 120
- Locked = -1 'True
- MultiLine = -1 'True
- TabIndex = 28
- Text = "ToExp.frx":038A
- Top = 240
- Width = 3495
- End
- Begin VB.Label Label17
- Height = 255
- Left = 120
- TabIndex = 29
- Top = 240
- Width = 1095
- End
- End
- Begin VB.Frame Frame2
- Height = 1215
- Left = 120
- TabIndex = 5
- Top = 5160
- Width = 3735
- Begin VB.TextBox Text1
- Alignment = 2 'Center
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000FF&
- Height = 320
- Left = 1080
- TabIndex = 9
- Text = "1"
- Top = 720
- Width = 615
- End
- Begin VB.ComboBox Combo2
- Height = 300
- ItemData = "ToExp.frx":0574
- Left = 1080
- List = "ToExp.frx":057B
- Style = 2 'Dropdown List
- TabIndex = 6
- Top = 240
- Width = 1575
- End
- Begin QQ伴侣.XPButton2 XPButton21
- Height = 345
- Left = 2720
- TabIndex = 10
- Top = 710
- Width = 855
- _ExtentX = 1508
- _ExtentY = 609
- Caption = "购买"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.Label Label9
- Caption = "120"
- Height = 255
- Left = 2025
- TabIndex = 16
- Top = 780
- Width = 735
- End
- Begin VB.Label Label8
- Caption = "¥"
- ForeColor = &H00FF0000&
- Height = 255
- Left = 1800
- TabIndex = 15
- Top = 780
- Width = 255
- End
- Begin VB.Label Label4
- Caption = "购买数量:"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 780
- Width = 975
- End
- Begin VB.Label Label3
- Caption = "购买种子:"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 300
- Width = 975
- End
- End
- Begin VB.Frame Frame1
- Height = 6255
- Left = 3960
- TabIndex = 0
- Top = 120
- Width = 3735
- Begin VB.Timer Timer6
- Interval = 1000
- Left = 2760
- Top = 1440
- End
- Begin MSWinsockLib.Winsock Winsock3
- Left = 1560
- Top = 1440
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.Timer Timer5
- Enabled = 0 'False
- Interval = 20
- Left = 2760
- Tag = "播种"
- Top = 840
- End
- Begin MSWinsockLib.Winsock Winsock2
- Left = 960
- Tag = "锄地"
- Top = 1440
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.Timer Timer4
- Enabled = 0 'False
- Interval = 20
- Left = 2160
- Tag = "铲除作物"
- Top = 840
- End
- Begin VB.Timer Timer3
- Interval = 5000
- Left = 1560
- Tag = "显示农场"
- Top = 840
- End
- Begin VB.Timer Timer2
- Enabled = 0 'False
- Interval = 2500
- Left = 960
- Tag = "更新背包"
- Top = 840
- End
- Begin MSWinsockLib.Winsock Winsock1
- Left = 360
- Tag = "买入种子"
- Top = 1440
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.Timer Timer1
- Enabled = 0 'False
- Interval = 20
- Left = 360
- Top = 840
- End
- Begin QQ伴侣.XPButton2 XPButton24
- Height = 375
- Left = 1260
- TabIndex = 30
- Top = 5715
- Width = 855
- _ExtentX = 1508
- _ExtentY = 661
- Caption = "停止"
- Enabled = 0 'False
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin QQ伴侣.XPButton2 XPButton23
- Height = 375
- Left = 2400
- TabIndex = 26
- Top = 5715
- Width = 1095
- _ExtentX = 1931
- _ExtentY = 661
- Caption = "后台工作"
- Enabled = 0 'False
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin QQ伴侣.XPButton2 XPButton22
- Height = 375
- Left = 120
- TabIndex = 20
- Top = 5715
- Width = 855
- _ExtentX = 1508
- _ExtentY = 661
- Caption = "开始"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.TextBox Text3
- Alignment = 2 'Center
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000FF&
- Height = 320
- IMEMode = 3 'DISABLE
- Left = 1080
- MaxLength = 5
- TabIndex = 18
- Text = "500"
- Top = 4860
- Width = 615
- End
- Begin VB.TextBox Text2
- Alignment = 2 'Center
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000FF&
- Height = 320
- IMEMode = 3 'DISABLE
- Left = 1080
- MaxLength = 5
- TabIndex = 12
- Text = "1"
- Top = 4440
- Width = 615
- End
- Begin VB.ComboBox Combo1
- Height = 300
- IMEMode = 3 'DISABLE
- ItemData = "ToExp.frx":058C
- Left = 1080
- List = "ToExp.frx":0596
- Style = 2 'Dropdown List
- TabIndex = 4
- Top = 4025
- Width = 1575
- End
- Begin VB.ListBox List2
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "宋体"
- Size = 10.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 3390
- ItemData = "ToExp.frx":05B6
- Left = 120
- List = "ToExp.frx":05B8
- TabIndex = 1
- Top = 480
- Width = 3495
- End
- Begin VB.Label Label16
- Caption = "刷新"
- ForeColor = &H00FF0000&
- Height = 255
- Left = 3120
- MouseIcon = "ToExp.frx":05BA
- MousePointer = 99 'Custom
- TabIndex = 25
- Top = 4500
- Width = 495
- End
- Begin VB.Label Label15
- Alignment = 2 'Center
- Caption = "0"
- ForeColor = &H000000FF&
- Height = 255
- Left = 2760
- TabIndex = 24
- Top = 5280
- Width = 615
- End
- Begin VB.Label Label14
- Caption = "获得经验:"
- Height = 255
- Left = 1800
- TabIndex = 23
- Top = 5280
- Width = 975
- End
- Begin VB.Label Label13
- Alignment = 2 'Center
- Caption = "0"
- ForeColor = &H000000FF&
- Height = 255
- Left = 1080
- TabIndex = 22
- Top = 5280
- Width = 615
- End
- Begin VB.Label Label12
- Caption = "成功次数:"
- Height = 255
- Left = 120
- TabIndex = 21
- Top = 5280
- Width = 975
- End
- Begin VB.Label Label11
- Caption = "毫秒"
- Height = 255
- Left = 1800
- TabIndex = 19
- Top = 4920
- Width = 495
- End
- Begin VB.Label Label10
- Caption = "操作延时:"
- Height = 375
- Left = 120
- TabIndex = 17
- Top = 4920
- Width = 1095
- End
- Begin VB.Label Label7
- Alignment = 2 'Center
- Caption = "0"
- ForeColor = &H000000FF&
- Height = 255
- Left = 2280
- TabIndex = 14
- Top = 4500
- Width = 735
- End
- Begin VB.Label Label6
- Caption = "剩余:"
- Height = 255
- Left = 1800
- TabIndex = 13
- Top = 4500
- Width = 1095
- End
- Begin VB.Label Label5
- Caption = "使用数量:"
- Height = 255
- Left = 120
- TabIndex = 11
- Top = 4500
- Width = 1095
- End
- Begin VB.Label Label2
- Caption = "选择作物:"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 4080
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "请选择一块空地 (鼠标双击可锄掉作物):"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 240
- Width = 3460
- End
- End
- End
- Attribute VB_Name = "ToExp"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim mairu As String
- Dim chudi As String
- Dim chudilx As Integer
- Dim bozhong As String
- Dim bozhongid As Integer
- Dim tudiid As Integer
- Dim sendtime As Long
- Private Sub Combo1_Click()
- On Error Resume Next
- Debug.Print mybox
- If Combo1.ListIndex = 0 Then
- If InStr(mybox, "/40|") > 0 Then
- Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
- Else
- Label7.Caption = 0
- End If
- Else
- If InStr(mybox, "/2|") > 0 Then
- Label7.Caption = Split(Split(mybox, "/2|")(1), "//")(0)
- Else
- Label7.Caption = 0
- End If
- End If
- If Val(Text2.Text) > Val(Label7.Caption) Then Text2.Text = Val(Label7.Caption)
- Text2.SelStart = Len(Text2.Text)
- End Sub
- Private Sub Form_Load()
- On Error Resume Next
- sexp = True
- Combo1.ListIndex = 0
- Combo2.ListIndex = 0
- Debug.Print mybox
- If Len(mybox) = 0 Then
- Call Label16_Click
- Else
- If InStr(mybox, "/40|") > 0 Then
- Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
- Else
- Label7.Caption = 0
- End If
- End If
- Call Timer3_Timer
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- If XPButton22.Enabled = False Then
- MsgBox "正在工作中,不能退出!如需隐藏,请点击“后台工作”! ", 48, "提醒"
- Cancel = True
- Exit Sub
- End If
- sexp = False
- End Sub
- Private Sub Label16_Click()
- Form1.bbi = 300 '背包
- Timer2.Enabled = True
- Label16.Enabled = False
- End Sub
- Private Sub List2_DblClick()
- On Error Resume Next
- If InStr(List2.Text, "空地") = 0 Then
- If MsgBox("您确定要铲掉该作物吗?", 32 Or vbYesNo, "锄地确认") = vbYes Then
- chudilx = 1
- tudiid = List2.ListIndex
- List2.Enabled = False
- Timer4.Enabled = True
- End If
- End If
- End Sub
- Private Sub Text1_Change()
- On Error Resume Next
- If Val(Text1.Text) > 99 Then Text1.Text = 99
- Text1.SelStart = Len(Text1.Text)
- Label9.Caption = Val(Text1.Text) * 120
- End Sub
- Private Sub Text2_Change()
- On Error Resume Next
- If Val(Text2.Text) > Val(Label7.Caption) Then Text2.Text = Val(Label7.Caption)
- Text2.SelStart = Len(Text2.Text)
- End Sub
- Private Sub Timer1_Timer()
- Timer1.Enabled = False
- mairu = ""
- If Proxy = 1 Then '使用代理
- Winsock1.Close
- Winsock1.RemoteHost = Proxy_IP
- Winsock1.RemotePort = Proxy_DK
- Winsock1.Connect
- Else
- Winsock1.Close
- If Farmqk = True Then
- Winsock1.RemoteHost = "happyfarm.xiaoyou.qq.com"
- Else
- Winsock1.RemoteHost = "happyfarm.qzone.qq.com"
- End If
- Winsock1.RemotePort = 80
- Winsock1.Connect
- End If
- End Sub
- Private Sub Timer2_Timer()
- Debug.Print mybox
- Timer2.Enabled = False
- If Combo1.ListIndex = 0 Then
- If InStr(mybox, "/40|") > 0 Then
- Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
- Else
- Label7.Caption = 0
- End If
- Else
- If InStr(mybox, "/2|") > 0 Then
- Label7.Caption = Split(Split(mybox, "/2|")(1), "//")(0)
- Else
- Label7.Caption = 0
- End If
- End If
- If Val(Text2.Text) > Val(Label7.Caption) And XPButton24.Enabled = False Then Text2.Text = 0
- Label16.Enabled = True
- End Sub
- Private Sub Timer3_Timer()
- On Error Resume Next
- Dim tem1 As String, tem2 As String
- Dim temp As Long
- Dim xiangtong As Boolean
- Dim rc As Integer
- Timer3.Interval = 5000
- If List2.Enabled = False Then Exit Sub
- '显示农场信息
- Set rs = New ADODB.Recordset
- rs.CursorLocation = adUseServer
- rs.Open "SELECT * FROM Farm where userid=" & Myuid & " order by Location", conn, 1, 1
- rc = rs.RecordCount
- If rc = 0 Then
- List2.AddItem "正在加载中..."
- Else
- If rs.RecordCount <> List2.ListCount Then
- List2.Clear
- ElseIf List2.ListCount > 0 Then
- xiangtong = True
- End If
- While Not rs.EOF
- K = K + 1
- Dim kk As String
- Dim mm As String
- kk = Replace(Format(rs.Fields("k"), "00"), "00", " 0")
- mm = Replace(Format(rs.Fields("m"), "00"), "00", "0 ")
- If kk > 0 Then
- If rs.Fields("m") = rs.Fields("l") Then
- If xiangtong = True Then
- List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 所剩无几"
- Else
- List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 所剩无几"
- End If
- Else
- If xiangtong = True Then
- List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 已经成熟"
- Else
- List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 已经成熟"
- End If
- End If
- Else
- If rs.Fields("Kind") = 0 Then
- If xiangtong = True Then
- List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")"
- Else
- List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")"
- End If
- Else
- temp = rs.Fields("q") - (DateDiff("s", DateSerial(1970, 1, 1), Now()) - shicha)
- If temp > 0 And temp <= 45 Then
- zdbs = True
- grsxsd = 4
- End If
- If xiangtong = True Then
- List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " " & time_m(rs.Fields("q"))
- Else
- List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " " & time_m(rs.Fields("q"))
- End If
- End If
- End If
- rs.MoveNext
- 'DoEvents
- Wend
- End If
- rs.Close '关闭数据库
- Set rs = Nothing
- End Sub
- Private Sub Timer5_Timer() '播种
- Timer5.Enabled = False
- bozhong = ""
- If Proxy = 1 Then '使用代理
- Winsock3.Close
- Winsock3.RemoteHost = Proxy_IP
- Winsock3.RemotePort = Proxy_DK
- Winsock3.Connect
- Else
- Winsock3.Close
- If Farmqk = True Then
- Winsock3.RemoteHost = "happyfarm.xiaoyou.qq.com"
- Else
- Winsock3.RemoteHost = "happyfarm.qzone.qq.com"
- End If
- Winsock3.RemotePort = 80
- Winsock3.Connect
- End If
- sendtime = time_c '发送时间
- End Sub
- Private Sub Timer6_Timer()
- If XPButton22.Enabled = False Then
- If time_c - sendtime > 60 Then
- sendtime = time_c
- Timer5.Enabled = True
- End If
- End If
- End Sub
- Private Sub Winsock3_Connect()
- On Error Resume Next
- Dim strCommand As String
- Dim proxytemp As String
- Randomize Timer
- If Proxy = 1 Then '使用代理
- If Farmqk = True Then
- proxytemp = "http://happyfarm.xiaoyou.qq.com"
- Else
- proxytemp = "http://happyfarm.qzone.qq.com"
- End If
- End If
- posttem = "farmTime=" & time_cx & "&farmKey=" & Farmkey_cx & "&place=" & tudiid & "&ownerId=" & Myuid & "&cId=" & bozhongid
- strCommand = "POST " & proxytemp & "/api.php?mod=farmlandstatus&act=planting HTTP/1.1" & vbCrLf
- strCommand = strCommand + "Accept: */*" + vbCrLf
- strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
- strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
- If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
- If Farmqk = True Then
- strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
- Else
- strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
- End If
- strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
- strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
- strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
- strCommand = strCommand & "Connection: close" & vbCrLf
- strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
- strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
- ' strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
- strCommand = strCommand & vbCrLf
- strCommand = strCommand & posttem
- Winsock3.SendData strCommand
- End Sub
- Private Sub Winsock3_DataArrival(ByVal bytesTotal As Long)
- On Error Resume Next
- ReDim str(bytesTotal - 1) As Byte
- Winsock3.GetData str, vbArray + vbByte
- bozhong = bozhong & UTF8_Decode(str)
- End Sub
- Private Sub Winsock3_Close()
- On Error Resume Next
- Dim code As Integer
- Dim exp As Integer
- Dim tem1 As String
- Dim farmlandIndex As Integer
- Winsock3.Close
- If Len(bozhong) > 0 Then
- '记录QQ服务器时间
- If InStr(bozhong, "Set-Cookie: pst=") > 0 Then
- Dim pst_temp As Long
- tem1 = Split(bozhong, "Set-Cookie: pst=")(1)
- pst_temp = Val(Split(tem1, ";")(0))
- If pst_temp > 0 Then pst = pst_temp
- End If
- code = split_m(1, bozhong, "code") '返回状态
- farmlandIndex = split_m(1, bozhong, "farmlandIndex") '农田ID
- If code = 1 Then
- Label7.Caption = Val(Label7.Caption) - 1
- Text2.Text = Val(Text2.Text) - 1
- If Val(Label7.Caption) < 0 Then Label7.Caption = 0
- If Val(Text2.Text) < 0 Then Text2.Text = 0
- End If
- Form1.bbi = 290
- If InStr(bozhong, "u6CA1u6709u8DB3u591Fu7684") > 0 Then '没有足够的种子啦!
- Form1.bbi = 290
- Call XPButton24_Click
- Call Label16_Click
- Else
- Timer4.Enabled = True
- End If
- bozhong = ""
- End If
- End Sub
- Private Sub Timer4_Timer() '锄地
- Timer4.Enabled = False
- chudi = ""
- If Proxy = 1 Then '使用代理
- Winsock2.Close
- Winsock2.RemoteHost = Proxy_IP
- Winsock2.RemotePort = Proxy_DK
- Winsock2.Connect
- Else
- Winsock2.Close
- If Farmqk = True Then
- Winsock2.RemoteHost = "happyfarm.xiaoyou.qq.com"
- Else
- Winsock2.RemoteHost = "happyfarm.qzone.qq.com"
- End If
- Winsock2.RemotePort = 80
- Winsock2.Connect
- End If
- sendtime = time_c '发送时间
- End Sub
- Private Sub Winsock2_Connect()
- On Error Resume Next
- Dim strCommand As String
- Dim proxytemp As String
- Randomize Timer
- If Proxy = 1 Then '使用代理
- If Farmqk = True Then
- proxytemp = "http://happyfarm.xiaoyou.qq.com"
- Else
- proxytemp = "http://happyfarm.qzone.qq.com"
- End If
- End If
- posttem = "farmTime=" & time_cx & "&farmKey=" & Farmkey_cx & "&place=" & tudiid & "&ownerId=" & Myuid
- strCommand = "POST " & proxytemp & "/api.php?mod=farmlandstatus&act=scarify HTTP/1.1" & vbCrLf
- strCommand = strCommand + "Accept: */*" + vbCrLf
- strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
- strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
- If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
- If Farmqk = True Then
- strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
- Else
- strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
- End If
- strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
- strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
- strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
- strCommand = strCommand & "Connection: close" & vbCrLf
- strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
- strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
- ' strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
- strCommand = strCommand & vbCrLf
- strCommand = strCommand & posttem
- Winsock2.SendData strCommand
- End Sub
- Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
- On Error Resume Next
- ReDim str(bytesTotal - 1) As Byte
- Winsock2.GetData str, vbArray + vbByte
- chudi = chudi & UTF8_Decode(str)
- End Sub
- Private Sub Winsock2_Close()
- On Error Resume Next
- Dim code As Integer
- Dim exp As Integer
- Dim tem1 As String
- Dim farmlandIndex As Integer
- Winsock2.Close
- If Len(chudi) > 0 Then
- '记录QQ服务器时间
- If InStr(chudi, "Set-Cookie: pst=") > 0 Then
- Dim pst_temp As Long
- tem1 = Split(chudi, "Set-Cookie: pst=")(1)
- pst_temp = Val(Split(tem1, ";")(0))
- If pst_temp > 0 Then pst = pst_temp
- End If
- code = split_m(1, chudi, "code") '返回状态
- farmlandIndex = split_m(1, chudi, "farmlandIndex") '农田ID
- If code = 1 Then
- exp = split_m(1, chudi, "exp") '经验
- If chudilx = 1 Then
- Timer3.Enabled = False
- Timer3.Interval = 15000
- Timer3.Enabled = True
- MsgBox "为自己的" & farmlandIndex + 1 & "号农田翻地成功!", 64, "锄地成功"
- List2.List(farmlandIndex) = farmlandIndex + 1 & "、空地 ( 0/0 )"
- List2.Enabled = True
- If Farmqk = True Then
- Call addsxlb(Myuid, 0) '加入刷新列表
- Else
- Call addsxlb(Myuid, 1) '加入刷新列表
- End If
- Else
- Label13.Caption = Val(Label13.Caption) + 1
- Label15.Caption = Val(Label15.Caption) + 2
- End If
- End If
- If chudilx = 0 Then
- If Val(Text2.Text) > 0 And XPButton22.Enabled = False Then
- Timer5.Enabled = True
- ElseIf Val(Text2.Text) = 0 Then
- If Farmqk = True Then
- Call addsxlb(Myuid, 0) '加入刷新列表
- Else
- Call addsxlb(Myuid, 1) '加入刷新列表
- End If
- XPButton22.Enabled = True
- XPButton24.Enabled = False
- XPButton23.Enabled = False
- If ToExp.Visible = False Then sexp = False
- If ToExp.Visible = True Then MsgBox "刷经验工作已完成,共使用了" & Label13.Caption & "颗种子,获得了" & Label15.Caption & "点经验。 ", 64, "完成"
- End If
- End If
- chudi = ""
- chudilx = 0
- End If
- End Sub
- Private Sub XPButton21_Click()
- If Len(Text1.Text) = 0 Then Text1.Text = 1
- If MsgBox("您确定要花费¥" & Label9.Caption & "金币,购买" & Text1.Text & "颗《牧草》种子吗?", 32 Or vbYesNo, "购买确认") = vbYes Then
- XPButton21.Enabled = False
- Timer1.Enabled = True
- End If
- End Sub
- Private Sub Winsock1_Connect()
- On Error Resume Next
- Dim strCommand As String
- Dim proxytemp As String
- Randomize Timer
- If Proxy = 1 Then '使用代理
- If Farmqk = True Then
- proxytemp = "http://happyfarm.xiaoyou.qq.com"
- Else
- proxytemp = "http://happyfarm.qzone.qq.com"
- End If
- End If
- posttem = "cId=40&number=" & Val(Text1.Text) & "&farmTime=" & time_cx & "&farmKey=" & Farmkey_cx
- strCommand = "POST " & proxytemp & "/api.php?mod=repertory&act=buySeed HTTP/1.1" & vbCrLf
- strCommand = strCommand + "Accept: */*" + vbCrLf
- strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
- strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
- If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
- If Farmqk = True Then
- strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
- Else
- strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
- End If
- strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
- strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
- strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
- strCommand = strCommand & "Connection: close" & vbCrLf
- strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
- strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
- ' strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
- strCommand = strCommand & vbCrLf
- strCommand = strCommand & posttem
- Winsock1.SendData strCommand
- End Sub
- Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
- On Error Resume Next
- ReDim str(bytesTotal - 1) As Byte
- Winsock1.GetData str, vbArray + vbByte
- mairu = mairu & UTF8_Decode(str)
- End Sub
- Private Sub Winsock1_Close()
- On Error Resume Next
- Dim code As Integer, money As String
- Winsock1.Close
- If Len(mairu) > 0 Then
- '记录QQ服务器时间
- If InStr(mairu, "Set-Cookie: pst=") > 0 Then
- Dim pst_temp As Long, tem1 As String
- tem1 = Split(maichu, "Set-Cookie: pst=")(1)
- pst_temp = Val(Split(tem1, ";")(0))
- If pst_temp > 0 Then pst = pst_temp
- End If
- code = split_m(1, mairu, "code")
- If code = 1 Then
- money = Abs(split_m(2, mairu, "money"))
- Num = split_m(1, mairu, "num")
- cId = split_m(1, mairu, "cId")
- Call jilu("购物", MyQQ, "你花了¥" & money & ",购买" & Text1.Text & "颗《牧草》种子")
- mairu = ""
- If Combo1.ListIndex = 0 Then
- Label7.Caption = Val(Label7.Caption) + Val(Text1.Text)
- End If
- MsgBox "购买成功,一共花了¥" & money, 64, "购买成功"
- If Farmqk = True Then
- Call addsxlb(Myuid, 0)
- Else
- Call addsxlb(Myuid, 1)
- End If
- Call Label16_Click
- ElseIf eode = 0 Then
- Dim direction As String
- direction = vbUnEscape(split_m(3, mairu, "direction"))
- Call jilu("购物", MyQQ, direction)
- mairu = ""
- MsgBox direction, 48, "买入失败"
- Else
- mairu = ""
- MsgBox "连接系统失败,可能是QQ服务器系统繁忙!", 48, "购物失败"
- End If
- Form1.bbi = 300
- XPButton21.Enabled = True
- End If
- End Sub
- Private Sub XPButton22_Click()
- On Error Resume Next
- Dim temp As String
- temp = List2.Text
- If List2.ListIndex = -1 Or InStr(temp, "空地") = 0 Then MsgBox "请选择一块空地,可以双击鼠标铲掉作物! ", 64, "提示": Exit Sub
- If Val(Text2.Text) = 0 Then MsgBox "请输入要使用的种子数量 ", 64, "提示": Exit Sub
- If Val(Text3.Text) < 100 Then MsgBox "操作延时请不要小于100 ", 64, "提示": Exit Sub
- XPButton22.Enabled = False
- XPButton24.Enabled = True
- XPButton23.Enabled = True
- Label13.Caption = 0
- Label15.Caption = 0
- If Combo1.ListIndex = 0 Then
- bozhongid = 40
- Else
- bozhongid = 2
- End If
- tudiid = List2.ListIndex
- Timer4.Interval = Val(Text3.Text)
- Timer5.Interval = Val(Text3.Text)
- Timer5.Enabled = True
- sendtime = time_c '发送时间
- End Sub
- Private Sub XPButton23_Click()
- ToExp.Visible = False
- MsgBox "已进入后台工作,您随时可以重新打开,查看工作情况! ", 64, "温馨提示"
- End Sub
- Private Sub XPButton24_Click()
- XPButton22.Enabled = True
- XPButton23.Enabled = False
- XPButton24.Enabled = False
- End Sub