ToExp.frm
上传用户:luoweizhao
上传日期:2022-08-01
资源大小:1290k
文件大小:35k
源码类别:

外挂编程

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form ToExp 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "作物刷经验辅助工具"
  6.    ClientHeight    =   6465
  7.    ClientLeft      =   45
  8.    ClientTop       =   435
  9.    ClientWidth     =   7830
  10.    Icon            =   "ToExp.frx":0000
  11.    LinkTopic       =   "Form8"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   6465
  15.    ScaleWidth      =   7830
  16.    StartUpPosition =   1  '所有者中心
  17.    Begin VB.Frame Frame3 
  18.       Caption         =   "功能介绍:"
  19.       Height          =   5055
  20.       Left            =   120
  21.       TabIndex        =   27
  22.       Top             =   120
  23.       Width           =   3735
  24.       Begin VB.TextBox Text4 
  25.          Appearance      =   0  'Flat
  26.          BeginProperty Font 
  27.             Name            =   "宋体"
  28.             Size            =   10.5
  29.             Charset         =   134
  30.             Weight          =   400
  31.             Underline       =   0   'False
  32.             Italic          =   0   'False
  33.             Strikethrough   =   0   'False
  34.          EndProperty
  35.          Height          =   4695
  36.          Left            =   120
  37.          Locked          =   -1  'True
  38.          MultiLine       =   -1  'True
  39.          TabIndex        =   28
  40.          Text            =   "ToExp.frx":038A
  41.          Top             =   240
  42.          Width           =   3495
  43.       End
  44.       Begin VB.Label Label17 
  45.          Height          =   255
  46.          Left            =   120
  47.          TabIndex        =   29
  48.          Top             =   240
  49.          Width           =   1095
  50.       End
  51.    End
  52.    Begin VB.Frame Frame2 
  53.       Height          =   1215
  54.       Left            =   120
  55.       TabIndex        =   5
  56.       Top             =   5160
  57.       Width           =   3735
  58.       Begin VB.TextBox Text1 
  59.          Alignment       =   2  'Center
  60.          Appearance      =   0  'Flat
  61.          BeginProperty Font 
  62.             Name            =   "宋体"
  63.             Size            =   10.5
  64.             Charset         =   134
  65.             Weight          =   400
  66.             Underline       =   0   'False
  67.             Italic          =   0   'False
  68.             Strikethrough   =   0   'False
  69.          EndProperty
  70.          ForeColor       =   &H000000FF&
  71.          Height          =   320
  72.          Left            =   1080
  73.          TabIndex        =   9
  74.          Text            =   "1"
  75.          Top             =   720
  76.          Width           =   615
  77.       End
  78.       Begin VB.ComboBox Combo2 
  79.          Height          =   300
  80.          ItemData        =   "ToExp.frx":0574
  81.          Left            =   1080
  82.          List            =   "ToExp.frx":057B
  83.          Style           =   2  'Dropdown List
  84.          TabIndex        =   6
  85.          Top             =   240
  86.          Width           =   1575
  87.       End
  88.       Begin QQ伴侣.XPButton2 XPButton21 
  89.          Height          =   345
  90.          Left            =   2720
  91.          TabIndex        =   10
  92.          Top             =   710
  93.          Width           =   855
  94.          _ExtentX        =   1508
  95.          _ExtentY        =   609
  96.          Caption         =   "购买"
  97.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  98.             Name            =   "Verdana"
  99.             Size            =   8.25
  100.             Charset         =   0
  101.             Weight          =   400
  102.             Underline       =   0   'False
  103.             Italic          =   0   'False
  104.             Strikethrough   =   0   'False
  105.          EndProperty
  106.       End
  107.       Begin VB.Label Label9 
  108.          Caption         =   "120"
  109.          Height          =   255
  110.          Left            =   2025
  111.          TabIndex        =   16
  112.          Top             =   780
  113.          Width           =   735
  114.       End
  115.       Begin VB.Label Label8 
  116.          Caption         =   "¥"
  117.          ForeColor       =   &H00FF0000&
  118.          Height          =   255
  119.          Left            =   1800
  120.          TabIndex        =   15
  121.          Top             =   780
  122.          Width           =   255
  123.       End
  124.       Begin VB.Label Label4 
  125.          Caption         =   "购买数量:"
  126.          Height          =   255
  127.          Left            =   120
  128.          TabIndex        =   8
  129.          Top             =   780
  130.          Width           =   975
  131.       End
  132.       Begin VB.Label Label3 
  133.          Caption         =   "购买种子:"
  134.          Height          =   255
  135.          Left            =   120
  136.          TabIndex        =   7
  137.          Top             =   300
  138.          Width           =   975
  139.       End
  140.    End
  141.    Begin VB.Frame Frame1 
  142.       Height          =   6255
  143.       Left            =   3960
  144.       TabIndex        =   0
  145.       Top             =   120
  146.       Width           =   3735
  147.       Begin VB.Timer Timer6 
  148.          Interval        =   1000
  149.          Left            =   2760
  150.          Top             =   1440
  151.       End
  152.       Begin MSWinsockLib.Winsock Winsock3 
  153.          Left            =   1560
  154.          Top             =   1440
  155.          _ExtentX        =   741
  156.          _ExtentY        =   741
  157.          _Version        =   393216
  158.       End
  159.       Begin VB.Timer Timer5 
  160.          Enabled         =   0   'False
  161.          Interval        =   20
  162.          Left            =   2760
  163.          Tag             =   "播种"
  164.          Top             =   840
  165.       End
  166.       Begin MSWinsockLib.Winsock Winsock2 
  167.          Left            =   960
  168.          Tag             =   "锄地"
  169.          Top             =   1440
  170.          _ExtentX        =   741
  171.          _ExtentY        =   741
  172.          _Version        =   393216
  173.       End
  174.       Begin VB.Timer Timer4 
  175.          Enabled         =   0   'False
  176.          Interval        =   20
  177.          Left            =   2160
  178.          Tag             =   "铲除作物"
  179.          Top             =   840
  180.       End
  181.       Begin VB.Timer Timer3 
  182.          Interval        =   5000
  183.          Left            =   1560
  184.          Tag             =   "显示农场"
  185.          Top             =   840
  186.       End
  187.       Begin VB.Timer Timer2 
  188.          Enabled         =   0   'False
  189.          Interval        =   2500
  190.          Left            =   960
  191.          Tag             =   "更新背包"
  192.          Top             =   840
  193.       End
  194.       Begin MSWinsockLib.Winsock Winsock1 
  195.          Left            =   360
  196.          Tag             =   "买入种子"
  197.          Top             =   1440
  198.          _ExtentX        =   741
  199.          _ExtentY        =   741
  200.          _Version        =   393216
  201.       End
  202.       Begin VB.Timer Timer1 
  203.          Enabled         =   0   'False
  204.          Interval        =   20
  205.          Left            =   360
  206.          Top             =   840
  207.       End
  208.       Begin QQ伴侣.XPButton2 XPButton24 
  209.          Height          =   375
  210.          Left            =   1260
  211.          TabIndex        =   30
  212.          Top             =   5715
  213.          Width           =   855
  214.          _ExtentX        =   1508
  215.          _ExtentY        =   661
  216.          Caption         =   "停止"
  217.          Enabled         =   0   'False
  218.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  219.             Name            =   "Verdana"
  220.             Size            =   8.25
  221.             Charset         =   0
  222.             Weight          =   400
  223.             Underline       =   0   'False
  224.             Italic          =   0   'False
  225.             Strikethrough   =   0   'False
  226.          EndProperty
  227.       End
  228.       Begin QQ伴侣.XPButton2 XPButton23 
  229.          Height          =   375
  230.          Left            =   2400
  231.          TabIndex        =   26
  232.          Top             =   5715
  233.          Width           =   1095
  234.          _ExtentX        =   1931
  235.          _ExtentY        =   661
  236.          Caption         =   "后台工作"
  237.          Enabled         =   0   'False
  238.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  239.             Name            =   "Verdana"
  240.             Size            =   8.25
  241.             Charset         =   0
  242.             Weight          =   400
  243.             Underline       =   0   'False
  244.             Italic          =   0   'False
  245.             Strikethrough   =   0   'False
  246.          EndProperty
  247.       End
  248.       Begin QQ伴侣.XPButton2 XPButton22 
  249.          Height          =   375
  250.          Left            =   120
  251.          TabIndex        =   20
  252.          Top             =   5715
  253.          Width           =   855
  254.          _ExtentX        =   1508
  255.          _ExtentY        =   661
  256.          Caption         =   "开始"
  257.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  258.             Name            =   "Verdana"
  259.             Size            =   8.25
  260.             Charset         =   0
  261.             Weight          =   400
  262.             Underline       =   0   'False
  263.             Italic          =   0   'False
  264.             Strikethrough   =   0   'False
  265.          EndProperty
  266.       End
  267.       Begin VB.TextBox Text3 
  268.          Alignment       =   2  'Center
  269.          Appearance      =   0  'Flat
  270.          BeginProperty Font 
  271.             Name            =   "宋体"
  272.             Size            =   10.5
  273.             Charset         =   134
  274.             Weight          =   400
  275.             Underline       =   0   'False
  276.             Italic          =   0   'False
  277.             Strikethrough   =   0   'False
  278.          EndProperty
  279.          ForeColor       =   &H000000FF&
  280.          Height          =   320
  281.          IMEMode         =   3  'DISABLE
  282.          Left            =   1080
  283.          MaxLength       =   5
  284.          TabIndex        =   18
  285.          Text            =   "500"
  286.          Top             =   4860
  287.          Width           =   615
  288.       End
  289.       Begin VB.TextBox Text2 
  290.          Alignment       =   2  'Center
  291.          Appearance      =   0  'Flat
  292.          BeginProperty Font 
  293.             Name            =   "宋体"
  294.             Size            =   10.5
  295.             Charset         =   134
  296.             Weight          =   400
  297.             Underline       =   0   'False
  298.             Italic          =   0   'False
  299.             Strikethrough   =   0   'False
  300.          EndProperty
  301.          ForeColor       =   &H000000FF&
  302.          Height          =   320
  303.          IMEMode         =   3  'DISABLE
  304.          Left            =   1080
  305.          MaxLength       =   5
  306.          TabIndex        =   12
  307.          Text            =   "1"
  308.          Top             =   4440
  309.          Width           =   615
  310.       End
  311.       Begin VB.ComboBox Combo1 
  312.          Height          =   300
  313.          IMEMode         =   3  'DISABLE
  314.          ItemData        =   "ToExp.frx":058C
  315.          Left            =   1080
  316.          List            =   "ToExp.frx":0596
  317.          Style           =   2  'Dropdown List
  318.          TabIndex        =   4
  319.          Top             =   4025
  320.          Width           =   1575
  321.       End
  322.       Begin VB.ListBox List2 
  323.          Appearance      =   0  'Flat
  324.          BeginProperty Font 
  325.             Name            =   "宋体"
  326.             Size            =   10.5
  327.             Charset         =   134
  328.             Weight          =   400
  329.             Underline       =   0   'False
  330.             Italic          =   0   'False
  331.             Strikethrough   =   0   'False
  332.          EndProperty
  333.          Height          =   3390
  334.          ItemData        =   "ToExp.frx":05B6
  335.          Left            =   120
  336.          List            =   "ToExp.frx":05B8
  337.          TabIndex        =   1
  338.          Top             =   480
  339.          Width           =   3495
  340.       End
  341.       Begin VB.Label Label16 
  342.          Caption         =   "刷新"
  343.          ForeColor       =   &H00FF0000&
  344.          Height          =   255
  345.          Left            =   3120
  346.          MouseIcon       =   "ToExp.frx":05BA
  347.          MousePointer    =   99  'Custom
  348.          TabIndex        =   25
  349.          Top             =   4500
  350.          Width           =   495
  351.       End
  352.       Begin VB.Label Label15 
  353.          Alignment       =   2  'Center
  354.          Caption         =   "0"
  355.          ForeColor       =   &H000000FF&
  356.          Height          =   255
  357.          Left            =   2760
  358.          TabIndex        =   24
  359.          Top             =   5280
  360.          Width           =   615
  361.       End
  362.       Begin VB.Label Label14 
  363.          Caption         =   "获得经验:"
  364.          Height          =   255
  365.          Left            =   1800
  366.          TabIndex        =   23
  367.          Top             =   5280
  368.          Width           =   975
  369.       End
  370.       Begin VB.Label Label13 
  371.          Alignment       =   2  'Center
  372.          Caption         =   "0"
  373.          ForeColor       =   &H000000FF&
  374.          Height          =   255
  375.          Left            =   1080
  376.          TabIndex        =   22
  377.          Top             =   5280
  378.          Width           =   615
  379.       End
  380.       Begin VB.Label Label12 
  381.          Caption         =   "成功次数:"
  382.          Height          =   255
  383.          Left            =   120
  384.          TabIndex        =   21
  385.          Top             =   5280
  386.          Width           =   975
  387.       End
  388.       Begin VB.Label Label11 
  389.          Caption         =   "毫秒"
  390.          Height          =   255
  391.          Left            =   1800
  392.          TabIndex        =   19
  393.          Top             =   4920
  394.          Width           =   495
  395.       End
  396.       Begin VB.Label Label10 
  397.          Caption         =   "操作延时:"
  398.          Height          =   375
  399.          Left            =   120
  400.          TabIndex        =   17
  401.          Top             =   4920
  402.          Width           =   1095
  403.       End
  404.       Begin VB.Label Label7 
  405.          Alignment       =   2  'Center
  406.          Caption         =   "0"
  407.          ForeColor       =   &H000000FF&
  408.          Height          =   255
  409.          Left            =   2280
  410.          TabIndex        =   14
  411.          Top             =   4500
  412.          Width           =   735
  413.       End
  414.       Begin VB.Label Label6 
  415.          Caption         =   "剩余:"
  416.          Height          =   255
  417.          Left            =   1800
  418.          TabIndex        =   13
  419.          Top             =   4500
  420.          Width           =   1095
  421.       End
  422.       Begin VB.Label Label5 
  423.          Caption         =   "使用数量:"
  424.          Height          =   255
  425.          Left            =   120
  426.          TabIndex        =   11
  427.          Top             =   4500
  428.          Width           =   1095
  429.       End
  430.       Begin VB.Label Label2 
  431.          Caption         =   "选择作物:"
  432.          Height          =   255
  433.          Left            =   120
  434.          TabIndex        =   3
  435.          Top             =   4080
  436.          Width           =   975
  437.       End
  438.       Begin VB.Label Label1 
  439.          Caption         =   "请选择一块空地 (鼠标双击可锄掉作物):"
  440.          Height          =   255
  441.          Left            =   120
  442.          TabIndex        =   2
  443.          Top             =   240
  444.          Width           =   3460
  445.       End
  446.    End
  447. End
  448. Attribute VB_Name = "ToExp"
  449. Attribute VB_GlobalNameSpace = False
  450. Attribute VB_Creatable = False
  451. Attribute VB_PredeclaredId = True
  452. Attribute VB_Exposed = False
  453. Dim mairu As String
  454. Dim chudi As String
  455. Dim chudilx As Integer
  456. Dim bozhong As String
  457. Dim bozhongid As Integer
  458. Dim tudiid As Integer
  459. Dim sendtime As Long
  460. Private Sub Combo1_Click()
  461. On Error Resume Next
  462. Debug.Print mybox
  463. If Combo1.ListIndex = 0 Then
  464.     If InStr(mybox, "/40|") > 0 Then
  465.        Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
  466.     Else
  467.        Label7.Caption = 0
  468.     End If
  469. Else
  470.     If InStr(mybox, "/2|") > 0 Then
  471.        Label7.Caption = Split(Split(mybox, "/2|")(1), "//")(0)
  472.     Else
  473.        Label7.Caption = 0
  474.     End If
  475. End If
  476.     If Val(Text2.Text) > Val(Label7.Caption) Then Text2.Text = Val(Label7.Caption)
  477.     Text2.SelStart = Len(Text2.Text)
  478. End Sub
  479. Private Sub Form_Load()
  480. On Error Resume Next
  481. sexp = True
  482. Combo1.ListIndex = 0
  483. Combo2.ListIndex = 0
  484. Debug.Print mybox
  485. If Len(mybox) = 0 Then
  486.    Call Label16_Click
  487. Else
  488.    If InStr(mybox, "/40|") > 0 Then
  489.       Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
  490.    Else
  491.       Label7.Caption = 0
  492.    End If
  493. End If
  494. Call Timer3_Timer
  495. End Sub
  496. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  497. If XPButton22.Enabled = False Then
  498.    MsgBox "正在工作中,不能退出!如需隐藏,请点击“后台工作”!   ", 48, "提醒"
  499.    Cancel = True
  500.    Exit Sub
  501. End If
  502. sexp = False
  503. End Sub
  504. Private Sub Label16_Click()
  505. Form1.bbi = 300   '背包
  506. Timer2.Enabled = True
  507. Label16.Enabled = False
  508. End Sub
  509. Private Sub List2_DblClick()
  510.     On Error Resume Next
  511.     If InStr(List2.Text, "空地") = 0 Then
  512.        If MsgBox("您确定要铲掉该作物吗?", 32 Or vbYesNo, "锄地确认") = vbYes Then
  513.           chudilx = 1
  514.           tudiid = List2.ListIndex
  515.           List2.Enabled = False
  516.           Timer4.Enabled = True
  517.        End If
  518.     End If
  519. End Sub
  520. Private Sub Text1_Change()
  521.     On Error Resume Next
  522.     If Val(Text1.Text) > 99 Then Text1.Text = 99
  523.     Text1.SelStart = Len(Text1.Text)
  524.     Label9.Caption = Val(Text1.Text) * 120
  525. End Sub
  526. Private Sub Text2_Change()
  527.     On Error Resume Next
  528.     If Val(Text2.Text) > Val(Label7.Caption) Then Text2.Text = Val(Label7.Caption)
  529.     Text2.SelStart = Len(Text2.Text)
  530. End Sub
  531. Private Sub Timer1_Timer()
  532.     Timer1.Enabled = False
  533.     mairu = ""
  534.     If Proxy = 1 Then  '使用代理
  535.         Winsock1.Close
  536.         Winsock1.RemoteHost = Proxy_IP
  537.         Winsock1.RemotePort = Proxy_DK
  538.         Winsock1.Connect
  539.     Else
  540.         Winsock1.Close
  541.         If Farmqk = True Then
  542.            Winsock1.RemoteHost = "happyfarm.xiaoyou.qq.com"
  543.         Else
  544.            Winsock1.RemoteHost = "happyfarm.qzone.qq.com"
  545.         End If
  546.         Winsock1.RemotePort = 80
  547.         Winsock1.Connect
  548.     End If
  549. End Sub
  550. Private Sub Timer2_Timer()
  551.     Debug.Print mybox
  552.     Timer2.Enabled = False
  553.     If Combo1.ListIndex = 0 Then
  554.         If InStr(mybox, "/40|") > 0 Then
  555.            Label7.Caption = Split(Split(mybox, "/40|")(1), "//")(0)
  556.         Else
  557.            Label7.Caption = 0
  558.         End If
  559.     Else
  560.         If InStr(mybox, "/2|") > 0 Then
  561.            Label7.Caption = Split(Split(mybox, "/2|")(1), "//")(0)
  562.         Else
  563.            Label7.Caption = 0
  564.         End If
  565.     End If
  566.     
  567.     If Val(Text2.Text) > Val(Label7.Caption) And XPButton24.Enabled = False Then Text2.Text = 0
  568.     
  569.     Label16.Enabled = True
  570. End Sub
  571. Private Sub Timer3_Timer()
  572.     On Error Resume Next
  573.     Dim tem1 As String, tem2 As String
  574.     Dim temp As Long
  575.     Dim xiangtong As Boolean
  576.     Dim rc As Integer
  577.     
  578.     Timer3.Interval = 5000
  579.     
  580.     If List2.Enabled = False Then Exit Sub
  581.     
  582.     '显示农场信息
  583.     Set rs = New ADODB.Recordset
  584.     rs.CursorLocation = adUseServer
  585.     rs.Open "SELECT  * FROM Farm where userid=" & Myuid & " order by Location", conn, 1, 1
  586.     rc = rs.RecordCount
  587.     If rc = 0 Then
  588.        List2.AddItem "正在加载中..."
  589.     Else
  590.         If rs.RecordCount <> List2.ListCount Then
  591.             List2.Clear
  592.         ElseIf List2.ListCount > 0 Then
  593.             xiangtong = True
  594.         End If
  595.         While Not rs.EOF
  596.             K = K + 1
  597.             Dim kk As String
  598.             Dim mm As String
  599.             kk = Replace(Format(rs.Fields("k"), "00"), "00", " 0")
  600.             mm = Replace(Format(rs.Fields("m"), "00"), "00", "0 ")
  601.             If kk > 0 Then
  602.                 If rs.Fields("m") = rs.Fields("l") Then
  603.                     If xiangtong = True Then
  604.                         List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 所剩无几"
  605.                     Else
  606.                         List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 所剩无几"
  607.                     End If
  608.                 Else
  609.                     If xiangtong = True Then
  610.                         List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 已经成熟"
  611.                     Else
  612.                         List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " 已经成熟"
  613.                     End If
  614.                 End If
  615.             Else
  616.                 If rs.Fields("Kind") = 0 Then
  617.                     If xiangtong = True Then
  618.                         List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")"
  619.                     Else
  620.                         List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")"
  621.                     End If
  622.                 Else
  623.                     
  624.                     temp = rs.Fields("q") - (DateDiff("s", DateSerial(1970, 1, 1), Now()) - shicha)
  625.                     
  626.                     If temp > 0 And temp <= 45 Then
  627.                        zdbs = True
  628.                        grsxsd = 4
  629.                     End If
  630.                     If xiangtong = True Then
  631.                         List2.List(K - 1) = K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " " & time_m(rs.Fields("q"))
  632.                     Else
  633.                         List2.AddItem K & "、" & zhonglei(rs.Fields("Kind"), 0) & "(" & kk & "/" & mm & ")" & " " & time_m(rs.Fields("q"))
  634.                     End If
  635.                 End If
  636.             End If
  637.             rs.MoveNext
  638.             'DoEvents
  639.         Wend
  640.     End If
  641.     rs.Close  '关闭数据库
  642.     Set rs = Nothing
  643. End Sub
  644. Private Sub Timer5_Timer()  '播种
  645.     Timer5.Enabled = False
  646.     bozhong = ""
  647.     
  648.     If Proxy = 1 Then  '使用代理
  649.         Winsock3.Close
  650.         Winsock3.RemoteHost = Proxy_IP
  651.         Winsock3.RemotePort = Proxy_DK
  652.         Winsock3.Connect
  653.     Else
  654.         Winsock3.Close
  655.         If Farmqk = True Then
  656.            Winsock3.RemoteHost = "happyfarm.xiaoyou.qq.com"
  657.         Else
  658.            Winsock3.RemoteHost = "happyfarm.qzone.qq.com"
  659.         End If
  660.         Winsock3.RemotePort = 80
  661.         Winsock3.Connect
  662.     End If
  663.     
  664.     sendtime = time_c  '发送时间
  665. End Sub
  666. Private Sub Timer6_Timer()
  667. If XPButton22.Enabled = False Then
  668.    If time_c - sendtime > 60 Then
  669.       sendtime = time_c
  670.       Timer5.Enabled = True
  671.    End If
  672. End If
  673. End Sub
  674. Private Sub Winsock3_Connect()
  675.     On Error Resume Next
  676.     Dim strCommand As String
  677.     Dim proxytemp As String
  678.     Randomize Timer
  679.     If Proxy = 1 Then  '使用代理
  680.         If Farmqk = True Then
  681.            proxytemp = "http://happyfarm.xiaoyou.qq.com"
  682.         Else
  683.            proxytemp = "http://happyfarm.qzone.qq.com"
  684.         End If
  685.     End If
  686.     posttem = "farmTime=" & time_cx & "&farmKey=" & Farmkey_cx & "&place=" & tudiid & "&ownerId=" & Myuid & "&cId=" & bozhongid
  687.     strCommand = "POST " & proxytemp & "/api.php?mod=farmlandstatus&act=planting HTTP/1.1" & vbCrLf
  688.     
  689.     strCommand = strCommand + "Accept: */*" + vbCrLf
  690.     strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
  691.     strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
  692.     If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
  693.     If Farmqk = True Then
  694.        strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
  695.     Else
  696.        strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
  697.     End If
  698.     strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
  699.     strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
  700.     strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
  701.     strCommand = strCommand & "Connection: close" & vbCrLf
  702.     strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
  703.     strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
  704. '    strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
  705.     strCommand = strCommand & vbCrLf
  706.     strCommand = strCommand & posttem
  707.     Winsock3.SendData strCommand
  708. End Sub
  709. Private Sub Winsock3_DataArrival(ByVal bytesTotal As Long)
  710.     On Error Resume Next
  711.     ReDim str(bytesTotal - 1) As Byte
  712.     Winsock3.GetData str, vbArray + vbByte
  713.     bozhong = bozhong & UTF8_Decode(str)
  714. End Sub
  715. Private Sub Winsock3_Close()
  716.     On Error Resume Next
  717.     Dim code As Integer
  718.     Dim exp As Integer
  719.     Dim tem1 As String
  720.     Dim farmlandIndex As Integer
  721.     Winsock3.Close
  722.     If Len(bozhong) > 0 Then
  723.         '记录QQ服务器时间
  724.         If InStr(bozhong, "Set-Cookie: pst=") > 0 Then
  725.             Dim pst_temp As Long
  726.             tem1 = Split(bozhong, "Set-Cookie: pst=")(1)
  727.             pst_temp = Val(Split(tem1, ";")(0))
  728.             If pst_temp > 0 Then pst = pst_temp
  729.         End If
  730.         code = split_m(1, bozhong, "code")  '返回状态
  731.         farmlandIndex = split_m(1, bozhong, "farmlandIndex") '农田ID
  732.         If code = 1 Then
  733.             Label7.Caption = Val(Label7.Caption) - 1
  734.             Text2.Text = Val(Text2.Text) - 1
  735.             
  736.             If Val(Label7.Caption) < 0 Then Label7.Caption = 0
  737.             If Val(Text2.Text) < 0 Then Text2.Text = 0
  738.         End If
  739.         Form1.bbi = 290
  740.         
  741.         If InStr(bozhong, "u6CA1u6709u8DB3u591Fu7684") > 0 Then  '没有足够的种子啦!
  742.            Form1.bbi = 290
  743.            Call XPButton24_Click
  744.            Call Label16_Click
  745.         Else
  746.            Timer4.Enabled = True
  747.         End If
  748.         bozhong = ""
  749.     End If
  750. End Sub
  751. Private Sub Timer4_Timer()  '锄地
  752.     Timer4.Enabled = False
  753.     chudi = ""
  754.     If Proxy = 1 Then  '使用代理
  755.         Winsock2.Close
  756.         Winsock2.RemoteHost = Proxy_IP
  757.         Winsock2.RemotePort = Proxy_DK
  758.         Winsock2.Connect
  759.     Else
  760.         Winsock2.Close
  761.         If Farmqk = True Then
  762.            Winsock2.RemoteHost = "happyfarm.xiaoyou.qq.com"
  763.         Else
  764.            Winsock2.RemoteHost = "happyfarm.qzone.qq.com"
  765.         End If
  766.         Winsock2.RemotePort = 80
  767.         Winsock2.Connect
  768.     End If
  769.     
  770.     sendtime = time_c  '发送时间
  771. End Sub
  772. Private Sub Winsock2_Connect()
  773.     On Error Resume Next
  774.     Dim strCommand As String
  775.     Dim proxytemp As String
  776.     Randomize Timer
  777.     If Proxy = 1 Then  '使用代理
  778.         If Farmqk = True Then
  779.            proxytemp = "http://happyfarm.xiaoyou.qq.com"
  780.         Else
  781.            proxytemp = "http://happyfarm.qzone.qq.com"
  782.         End If
  783.     End If
  784.     posttem = "farmTime=" & time_cx & "&farmKey=" & Farmkey_cx & "&place=" & tudiid & "&ownerId=" & Myuid
  785.     strCommand = "POST " & proxytemp & "/api.php?mod=farmlandstatus&act=scarify HTTP/1.1" & vbCrLf
  786.     
  787.     strCommand = strCommand + "Accept: */*" + vbCrLf
  788.     strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
  789.     strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
  790.     If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
  791.     If Farmqk = True Then
  792.        strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
  793.     Else
  794.        strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
  795.     End If
  796.     strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
  797.     strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
  798.     strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
  799.     strCommand = strCommand & "Connection: close" & vbCrLf
  800.     strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
  801.     strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
  802. '    strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
  803.     strCommand = strCommand & vbCrLf
  804.     strCommand = strCommand & posttem
  805.     Winsock2.SendData strCommand
  806. End Sub
  807. Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
  808.     On Error Resume Next
  809.     ReDim str(bytesTotal - 1) As Byte
  810.     Winsock2.GetData str, vbArray + vbByte
  811.     chudi = chudi & UTF8_Decode(str)
  812. End Sub
  813. Private Sub Winsock2_Close()
  814.     On Error Resume Next
  815.     Dim code As Integer
  816.     Dim exp As Integer
  817.     Dim tem1 As String
  818.     Dim farmlandIndex As Integer
  819.     Winsock2.Close
  820.     If Len(chudi) > 0 Then
  821.         '记录QQ服务器时间
  822.         If InStr(chudi, "Set-Cookie: pst=") > 0 Then
  823.             Dim pst_temp As Long
  824.             tem1 = Split(chudi, "Set-Cookie: pst=")(1)
  825.             pst_temp = Val(Split(tem1, ";")(0))
  826.             If pst_temp > 0 Then pst = pst_temp
  827.         End If
  828.         code = split_m(1, chudi, "code")  '返回状态
  829.         farmlandIndex = split_m(1, chudi, "farmlandIndex") '农田ID
  830.         If code = 1 Then
  831.             exp = split_m(1, chudi, "exp") '经验
  832.             If chudilx = 1 Then
  833.                Timer3.Enabled = False
  834.                Timer3.Interval = 15000
  835.                Timer3.Enabled = True
  836.                
  837.                MsgBox "为自己的" & farmlandIndex + 1 & "号农田翻地成功!", 64, "锄地成功"
  838.                List2.List(farmlandIndex) = farmlandIndex + 1 & "、空地 ( 0/0 )"
  839.                List2.Enabled = True
  840.                If Farmqk = True Then
  841.                   Call addsxlb(Myuid, 0)  '加入刷新列表
  842.                Else
  843.                   Call addsxlb(Myuid, 1)  '加入刷新列表
  844.                End If
  845.             Else
  846.                Label13.Caption = Val(Label13.Caption) + 1
  847.                Label15.Caption = Val(Label15.Caption) + 2
  848.             End If
  849.         End If
  850.         If chudilx = 0 Then
  851.            If Val(Text2.Text) > 0 And XPButton22.Enabled = False Then
  852.               Timer5.Enabled = True
  853.            ElseIf Val(Text2.Text) = 0 Then
  854.               If Farmqk = True Then
  855.                  Call addsxlb(Myuid, 0)  '加入刷新列表
  856.               Else
  857.                  Call addsxlb(Myuid, 1)  '加入刷新列表
  858.               End If
  859.               XPButton22.Enabled = True
  860.               XPButton24.Enabled = False
  861.               XPButton23.Enabled = False
  862.               If ToExp.Visible = False Then sexp = False
  863.               If ToExp.Visible = True Then MsgBox "刷经验工作已完成,共使用了" & Label13.Caption & "颗种子,获得了" & Label15.Caption & "点经验。   ", 64, "完成"
  864.            End If
  865.         End If
  866.         chudi = ""
  867.         chudilx = 0
  868.     End If
  869. End Sub
  870. Private Sub XPButton21_Click()
  871.     If Len(Text1.Text) = 0 Then Text1.Text = 1
  872.     If MsgBox("您确定要花费¥" & Label9.Caption & "金币,购买" & Text1.Text & "颗《牧草》种子吗?", 32 Or vbYesNo, "购买确认") = vbYes Then
  873.         XPButton21.Enabled = False
  874.         Timer1.Enabled = True
  875.     End If
  876. End Sub
  877. Private Sub Winsock1_Connect()
  878.     On Error Resume Next
  879.     Dim strCommand As String
  880.     Dim proxytemp As String
  881.     Randomize Timer
  882.     If Proxy = 1 Then  '使用代理
  883.         If Farmqk = True Then
  884.            proxytemp = "http://happyfarm.xiaoyou.qq.com"
  885.         Else
  886.            proxytemp = "http://happyfarm.qzone.qq.com"
  887.         End If
  888.     End If
  889.     posttem = "cId=40&number=" & Val(Text1.Text) & "&farmTime=" & time_cx & "&farmKey=" & Farmkey_cx
  890.     strCommand = "POST " & proxytemp & "/api.php?mod=repertory&act=buySeed HTTP/1.1" & vbCrLf
  891.     strCommand = strCommand + "Accept: */*" + vbCrLf
  892.     strCommand = strCommand + "Accept-Language: zh-cn" + vbCrLf
  893.     strCommand = strCommand + "Accept-Encoding: gzip, deflate" + vbCrLf
  894.     If Proxy = 1 And Len(Basic) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & Basic & vbCrLf
  895.     If Farmqk = True Then
  896.        strCommand = strCommand & "Host: happyfarm.xiaoyou.qq.com" & vbCrLf
  897.     Else
  898.        strCommand = strCommand & "Host: happyfarm.qzone.qq.com" & vbCrLf
  899.     End If
  900.     strCommand = strCommand & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
  901.     strCommand = strCommand & "Referer: http://appimg.qq.com/happyfarm/module/Main_v_" & flashbb & ".swf" & vbCrLf
  902.     strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
  903.     strCommand = strCommand & "Connection: close" & vbCrLf
  904.     strCommand = strCommand & "Content-Length: " & Len(posttem) & vbCrLf
  905.     strCommand = strCommand & "Cookie: " & FarmCookies & vbCrLf
  906. '    strCommand = strCommand & "Cookie: uin=" & login_uid & "; skey=" & login_skey & "; pst=" & pst - 5 & ";" & vbCrLf
  907.     strCommand = strCommand & vbCrLf
  908.     strCommand = strCommand & posttem
  909.     Winsock1.SendData strCommand
  910. End Sub
  911. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  912.     On Error Resume Next
  913.     ReDim str(bytesTotal - 1) As Byte
  914.     Winsock1.GetData str, vbArray + vbByte
  915.     mairu = mairu & UTF8_Decode(str)
  916. End Sub
  917. Private Sub Winsock1_Close()
  918.     On Error Resume Next
  919.     Dim code As Integer, money As String
  920.     Winsock1.Close
  921.     If Len(mairu) > 0 Then
  922.         '记录QQ服务器时间
  923.         If InStr(mairu, "Set-Cookie: pst=") > 0 Then
  924.             Dim pst_temp As Long, tem1 As String
  925.             tem1 = Split(maichu, "Set-Cookie: pst=")(1)
  926.             pst_temp = Val(Split(tem1, ";")(0))
  927.             If pst_temp > 0 Then pst = pst_temp
  928.         End If
  929.         code = split_m(1, mairu, "code")
  930.         If code = 1 Then
  931.             money = Abs(split_m(2, mairu, "money"))
  932.             Num = split_m(1, mairu, "num")
  933.             cId = split_m(1, mairu, "cId")
  934.             Call jilu("购物", MyQQ, "你花了¥" & money & ",购买" & Text1.Text & "颗《牧草》种子")
  935.             mairu = ""
  936.             If Combo1.ListIndex = 0 Then
  937.                Label7.Caption = Val(Label7.Caption) + Val(Text1.Text)
  938.             End If
  939.             MsgBox "购买成功,一共花了¥" & money, 64, "购买成功"
  940.             If Farmqk = True Then
  941.                Call addsxlb(Myuid, 0)
  942.             Else
  943.                Call addsxlb(Myuid, 1)
  944.             End If
  945.             Call Label16_Click
  946.         ElseIf eode = 0 Then
  947.             Dim direction As String
  948.             direction = vbUnEscape(split_m(3, mairu, "direction"))
  949.             Call jilu("购物", MyQQ, direction)
  950.             mairu = ""
  951.             MsgBox direction, 48, "买入失败"
  952.         Else
  953.             mairu = ""
  954.             MsgBox "连接系统失败,可能是QQ服务器系统繁忙!", 48, "购物失败"
  955.         End If
  956.         Form1.bbi = 300
  957.         XPButton21.Enabled = True
  958.     End If
  959. End Sub
  960. Private Sub XPButton22_Click()
  961.     On Error Resume Next
  962.     Dim temp As String
  963.     temp = List2.Text
  964.     If List2.ListIndex = -1 Or InStr(temp, "空地") = 0 Then MsgBox "请选择一块空地,可以双击鼠标铲掉作物!  ", 64, "提示": Exit Sub
  965.     If Val(Text2.Text) = 0 Then MsgBox "请输入要使用的种子数量  ", 64, "提示": Exit Sub
  966.     If Val(Text3.Text) < 100 Then MsgBox "操作延时请不要小于100  ", 64, "提示": Exit Sub
  967.     XPButton22.Enabled = False
  968.     XPButton24.Enabled = True
  969.     XPButton23.Enabled = True
  970.     
  971.     Label13.Caption = 0
  972.     Label15.Caption = 0
  973.     
  974.     If Combo1.ListIndex = 0 Then
  975.        bozhongid = 40
  976.     Else
  977.        bozhongid = 2
  978.     End If
  979.     
  980.     tudiid = List2.ListIndex
  981.     Timer4.Interval = Val(Text3.Text)
  982.     Timer5.Interval = Val(Text3.Text)
  983.     Timer5.Enabled = True
  984.     
  985.     sendtime = time_c  '发送时间
  986. End Sub
  987. Private Sub XPButton23_Click()
  988.     ToExp.Visible = False
  989.     MsgBox "已进入后台工作,您随时可以重新打开,查看工作情况!  ", 64, "温馨提示"
  990. End Sub
  991. Private Sub XPButton24_Click()
  992.     XPButton22.Enabled = True
  993.     XPButton23.Enabled = False
  994.     XPButton24.Enabled = False
  995. End Sub