用VB制作简单的外挂【菜鸟入门学习】
[color=blue][b]今天要做的外挂是QQ游戏连连看的外挂相当不错
这东西已经开源了,所以轻松搞到代码[/b]
[/color]
[b]代码如下:[/b]
[b]Dim Begin As Long, Begin1 As Long
Private Sub Form_Load()
Command1.Enabled = True: Command2.Enabled = False
Command1.Caption = "一键秒杀": Command2.Caption = "停止秒杀"
Timer1.Enabled = False: Timer1.Interval = 500
End Sub[/b]
[b]Private Sub Label1_Click()
Shell "explorer.exe [/b][url=http://www.baidu.com/topbesthacker][b]http://www.baidu.com/topbesthacker[/b][/url][b]"
End Sub[/b]
[b]Private Sub Command1_Click()
Timer1.Enabled = 1
Command1.Enabled = False
Command2.Enabled = 1
End Sub[/b]
[b]Private Sub Command2_Click()
Timer1.Enabled = 0
Command1.Enabled = 1
Command2.Enabled = 0
SetWindowPos g_WindowHwnd, -2, 0, 0, 0, 0, &H2 Or &H1
End Sub[/b]
[b]Private Sub Timer1_Timer()
g_WindowHwnd = FindWindow("#32770", "QQ游戏 - 连连看角色版")
SetWindowPos g_WindowHwnd, -1, 0, 0, 0, 0, &H2 Or &H1
If g_WindowHwnd = 0 Then Exit Sub[/b]
[b]Begin = getcolor(643, 563)
Begin1 = getcolor(647, 523)
If Begin = 15783104 And Begin1 = 15783104 Then
Get_Boxs
Kill_Box
Else
Command2_Click
End If
End Sub
---------------------------------------------------------------------------------------------------------------------
以下是模块代码:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Public windowDC As Long[/b]
[b]Public Type POINTAPI
X As Long
Y As Long
End Type
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type[/b]
[b]Public Type BOX
X As Integer
Y As Integer
Type As Integer
End Type
[/b]
[b]Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_MOVE = &H1
Public Const MOUSEEVENTF_ABSOLUTE = &H8000
[/b]
[b]Public Const BOX_WIDTH As Integer = 31
Public Const BOX_HEIGHT As Integer = 35[/b]
[b]Public Const GAME_LEFT As Integer = 14
Public Const GAME_TOP As Integer = 181[/b]
[b]Public g_WindowHwnd As Long[/b]
[b]Public Boxs(1 To 19, 1 To 11) As BOX[/b]
[b]Public Function Get_Boxs()
Dim i As Integer
Dim j As Integer[/b]
[b]Dim color1 As Long[/b]
[b]For i = 1 To 19
For j = 1 To 11
With Boxs(i, j)
.X = GAME_LEFT + 14 + BOX_WIDTH * (i - 1)
.Y = GAME_TOP + 14 + BOX_HEIGHT * (j - 1)[/b]
[b]color1 = getcolor(.X, .Y)
[/b]
[b]If color1 = 16294952 Then
.Type = 1
ElseIf color1 = 10344 Then
.Type = 2
ElseIf color1 = 4230280 Then
.Type = 3
ElseIf color1 = 48360 Then
.Type = 4
ElseIf color1 = 16303256 Then
.Type = 5
ElseIf color1 = 1050664 Then
.Type = 6
ElseIf color1 = 10505360 Then
.Type = 7
ElseIf color1 = 3697816 Then
.Type = 8
ElseIf color1 = 6828032 Then
.Type = 9
ElseIf color1 = 12083200 Then
.Type = 10
ElseIf color1 = 13681792 Then
.Type = 11
ElseIf color1 = 1068160 Then
.Type = 12
ElseIf color1 = 3685440 Then
.Type = 13
ElseIf color1 = 248 Then
.Type = 14
ElseIf color1 = 3702840 Then
.Type = 15
ElseIf color1 = 8951920 Then
.Type = 16
ElseIf color1 = 1606816 Then
.Type = 17
ElseIf color1 = 10529896 Then
.Type = 18
ElseIf color1 = 3676184 Then
.Type = 19
ElseIf color1 = 11019432 Then
.Type = 20
ElseIf color1 = 0 Then
.Type = 21
ElseIf color1 = 3686496 Then
.Type = 22
ElseIf color1 = 13160664 Then
.Type = 23
ElseIf color1 = 15783056 Then
.Type = 24
ElseIf color1 = 1050792 Then
.Type = 25
ElseIf color1 = 6864120 Then
.Type = 26
ElseIf color1 = 12611656 Then
.Type = 27
ElseIf color1 = 4211936 Then
.Type = 28
ElseIf color1 = 232 Then
.Type = 29
ElseIf color1 = 15251592 Then
.Type = 30
ElseIf color1 = 40184 Then
.Type = 31
ElseIf color1 = 16312496 Then
.Type = 32
ElseIf color1 = 40992 Then
.Type = 33
ElseIf color1 = 5805216 Then
.Type = 34
ElseIf color1 = 10312 Then
.Type = 35
ElseIf color1 = 13682864 Then
.Type = 36
ElseIf color1 = 9474192 Then
.Type = 37
ElseIf color1 = 1579256 Then
.Type = 38
ElseIf color1 = 16317688 Then
.Type = 39
ElseIf color1 = 7404792 Then
.Type = 40
ElseIf color1 = 5800144 Then
.Type = 41
ElseIf color1 = 4247760 Then
.Type = 42
ElseIf color1 = 14681336 Then
.Type = 43
ElseIf color1 = 12619832 Then
.Type = 45
Else
.Type = 44
End If
End With
Next j
Next i
End Function[/b]
[b]Public Function Kill_Box()
Dim i As Integer
Dim j As Integer
Dim t As Integer
For i = 1 To 19
For j = 1 To 11
For m = i To 19
For n = 1 To 11[/b]
[b]If Boxs(m, n).Type = Boxs(i, j).Type And Boxs(m, n).Type <> 44 And ((m = i And n > j) Or m > i) Then[/b]
[b]t = GetPosition(i, j, m, n)
LJPD i, j, m, n, t
End If
Next
Next
Next
Next[/b]
[b]End Function[/b]
[b]Public Sub mouseClick(ByVal X As Long, ByVal Y As Long)
Dim po As POINTAPI
Dim kX As Long
Dim kY As Long
Dim winRECT As RECT
[/b]
[b]GetWindowRect g_WindowHwnd, winRECT
[/b]
[b]kX = winRECT.Left + X
kY = winRECT.Top + Y[/b]
[b]GetCursorPos po[/b]
[b]mouse_event MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, kX * 65535 / 1024, kY * 65535 / 768, 0&, 0&[/b]
[b]
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0&, 0&[/b]
[b]SetCursorPos po.X, po.Y
End Sub[/b]
[b]Public Function getcolor(ByVal newX As Long, ByVal newY As Long) As Long[/b]
[b]windowDC = GetDC(g_WindowHwnd)[/b]
[b]getcolor = GetPixel(windowDC, newX, newY)[/b]
[b]ReleaseDC g_WindowHwnd, windowDC
End Function[/b]
[b]Public Function GetPosition(ByVal x11 As Long, ByVal y11 As Long, ByVal x22 As Long, ByVal y22 As Long) As Long
If x11 = x22 And y11 < y22 Then
GetPosition = 1
ElseIf y11 = y22 And x11 < x22 Then
GetPosition = 2
ElseIf x11 < x22 And y11 < y22 Then
GetPosition = 3
ElseIf x11 < x22 And y11 > y22 Then
GetPosition = 4
ElseIf x11 = x22 And y22 = y11 Then
GetPosition = 0
End If
End Function[/b]
[b]Public Sub LJPD(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal p As Long)
Dim road As Boolean
road = True
Select Case p
Case 1
road = True
If y1 = y2 - 1 Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
Else[/b]
[b]road = True
For i = y1 + 1 To y2 - 1
If Boxs(x1, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If[/b]
[b]road = True
If x1 > 1 Then
For i = x1 - 1 To 1 Step -1
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y1).Type = Boxs(i, y2).Type Then[/b]
[b]road = True
For j = y1 To y2
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
If x1 < 19 Then
For i = x1 + 1 To 19
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y1).Type = Boxs(i, y2).Type Then[/b]
[b]
For j = y1 To y2
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]Case 2
road = True
If x1 = x2 - 1 Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
Else
' 1--2
'
'
road = True
For i = x1 + 1 To x2 - 1
If Boxs(i, y1).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If[/b]
[b]road = True
If y1 > 1 Then
For i = y1 - 1 To 1 Step -1
road = True
If Boxs(x1, i).Type = 44 And Boxs(x2, i).Type = 44 Then[/b]
[b]
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
If x1 < 11 Then
For i = y1 + 1 To 11
road = True
If Boxs(x1, i).Type = 44 And Boxs(x1, i).Type = Boxs(x2, i).Type Then[/b]
[b]
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]Case 3[/b]
[b]road = True[/b]
[b]For i = y2 - 1 To y1 Step -1
If Boxs(x2, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If y1 > 1 Then[/b]
[b]For i = y1 - 1 To 1 Step -1
road = True
If Boxs(x1, i).Type = 44 And Boxs(x2, i).Type = 44 Then
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
For i = x1 + 1 To x2
If Boxs(i, y1).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If
road = True[/b]
[b]For i = y1 + 1 To y2
If Boxs(x1, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If y2 < 11 Then[/b]
[b]For i = y2 + 1 To 11
road = True
If Boxs(x1, i).Type = 44 And Boxs(x2, i).Type = 44 Then
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
For i = x1 To x2 - 1
If Boxs(i, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If
road = True[/b]
[b]
For i = x2 - 1 To x1 Step -1
If Boxs(i, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If x1 > 1 Then[/b]
[b]For i = x1 - 1 To 1 Step -1
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y2).Type = 44 Then
For j = y1 To y2
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If
End If[/b]
[b]road = True[/b]
[b]
For i = x1 + 1 To x2
If Boxs(i, y1).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If x2 < 19 Then[/b]
[b]For i = x2 + 1 To 19
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y2).Type = 44 Then
For j = y1 To y2
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If
End If
road = True
[/b]
[b]
For i = x1 + 1 To x2 - 1
road = True
If Boxs(i, y1).Type = 44 Then
For j = x2 - 1 To i Step -1
If Boxs(j, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
For k = y1 To y2
If Boxs(i, k).Type <> 44 Then road = False: Exit For
Next
End If
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else
road = False: Exit For
End If
Next[/b]
[b]road = True
[/b]
[b]
For i = y1 + 1 To y2 - 1
road = True
If Boxs(x1, i).Type = 44 Then
For j = y2 - 1 To i Step -1
If Boxs(x2, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
For k = x1 To x2
If Boxs(k, i).Type <> 44 Then road = False: Exit For
Next
End If
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else
road = False: Exit For
End If
Next[/b]
[b]Case 4[/b]
[b]
road = True
For i = y1 - 1 To y2 Step -1
If Boxs(x1, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If y2 > 1 Then[/b]
[b]For i = y2 - 1 To 1 Step -1
road = True
If Boxs(x1, i).Type = 44 And Boxs(x2, i).Type = 44 Then
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
For i = x1 To x2 - 1
If Boxs(i, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If
road = True[/b]
[b]For i = y2 + 1 To y1
If Boxs(x2, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If y1 < 11 Then[/b]
[b]For i = y1 + 1 To 11
road = True
If Boxs(x1, i).Type = 44 And Boxs(x2, i).Type = 44 Then
For j = x1 To x2
If Boxs(j, i).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If[/b]
[b]road = True
For i = x1 + 1 To x2
If Boxs(i, y1).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
End If
road = True[/b]
[b]
For i = x2 - 1 To x1 Step -1
If Boxs(i, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If x1 > 1 Then[/b]
[b]For i = x1 - 1 To 1 Step -1
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y2).Type = 44 Then
For j = y2 To y1
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If
End If[/b]
[b]road = True[/b]
[b]
For i = x1 + 1 To x2
If Boxs(i, y1).Type <> 44 Then road = False: Exit For
Next
If road = True Then
If x2 < 19 Then[/b]
[b]For i = x2 + 1 To 19
road = True
If Boxs(i, y1).Type = 44 And Boxs(i, y2).Type = 44 Then
For j = y1 To y2
If Boxs(i, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else[/b]
[b]road = False: Exit For
End If
Next
End If
End If[/b]
[b]road = True
[/b]
[b]
For i = x1 + 1 To x2 - 1
road = True
If Boxs(i, y1).Type = 44 Then
For j = x2 - 1 To i Step -1
If Boxs(j, y2).Type <> 44 Then road = False: Exit For
Next
If road = True Then
For k = y2 To y1
If Boxs(i, k).Type <> 44 Then road = False: Exit For
Next
End If
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else
road = False: Exit For
End If
Next
road = True
[/b]
[b]
For i = y1 - 1 To y2 + 1 Step -1
road = True
If Boxs(x1, i).Type = 44 Then
For j = y2 + 1 To i
If Boxs(x2, j).Type <> 44 Then road = False: Exit For
Next
If road = True Then
For k = x1 To x2
If Boxs(k, i).Type <> 44 Then road = False: Exit For
Next
End If
If road = True Then
mouseClick (x1 - 1) * 31 + 14 + GAME_LEFT, (y1 - 1) * 35 + 14 + GAME_TOP
mouseClick (x2 - 1) * 31 + 14 + GAME_LEFT, (y2 - 1) * 35 + 14 + GAME_TOP
Boxs(x2, y2).Type = 44: Boxs(x1, y1).Type = 44
Exit Sub
End If
Else
road = False: Exit For
End If
Next[/b]
[b]End Select
End Sub
[/b]
[b]--------------------------------------[/b]
[color=blue][b]有兴趣的朋友可以复制下内容[/b]
[b]打开VB创建个EXE[/b]
[b]填入代码[/b]
[b]区分模块与窗体不同[/b]
[b]就是模块复制到模块去[/b]
[b]窗体的复制窗体[/b]
[b]然后自己设计图暗[/b]
[b]改名字改图标改版权[/b]
[b]图标在Form1中的ICON处改[/b]
[b]插入你想要的图标[/b]
[b]就可以了···复制代码就可以产生一个可用的外挂[/b][/color]
[b]
[img]http://bbs.hack58.com/attachment/Fid_109/109_38859_12a8cd955025c8c.jpg[/img][/b]
[b][img]http://bbs.hack58.com/attachment/Fid_109/109_38859_0e9ee582ccf2ed3.jpg[/img][/b]
[color=blue][b]激动把[/b]
[b]自己也能做外挂的说[/b]
[b]虽然是别人的代码[/b]
[b]不过这个对于菜菜编程来说[/b]
[/color][b][color=blue]是一个不小的突破[/color]
[/b]
[[i] 本帖最后由 fengchen 于 2008-4-3 21:01 编辑 [/i]] ::08:: 那么多代码,还说简单。汗! 顶顶顶::04:: ::04:: ::04:: ::04:: ::04:: ::04:: ::04:: ::04:: 挖只要你复制下代码就好了
还不简单?· Dim Begin As Long, Begin1 As Long什么意思? 哈哈.最近学习网游外挂..终于小有成就了.....也在编写的过程中学习了不少东西.明白了自己还有很多没学过...要继续努力..... ::04:: 嘿嘿。。。我去做个看看效果咋样 ::04:: ::04:: ::04:: ::04:: 顶顶 呵呵VB写的, 个人认为VB代码看起来没C\C++舒服... 习惯问题吧::08::
雪碧
VB中Dim是用来声明用的::10:: 看不懂代码怎么办? 不会就是这样盲目的复制过去吧```````:face17 了解一下~~~呵呵~~~....... 是个什么游戏的外挂啊?难道是cs的?一键秒杀令人想起cs啊! 楼主最好在程序中写上注释,这样更利于别人来阅读。要是直接复制过去生成,那这对那些想学习编程的人来说未免太损失了吧? 本人爱斗地主,一直在研究挂,可是没有结果
要是有代码就好了:face14 代码太多了看不过来。只是代码能少一点步好了 看不懂...不过看了就要回帖的 LZ辛苦了::06:: :face12 :face12 :face12 激动啊 去试下 呵呵 heh 好哇
好东西 看看再说 学习中。。。。。。::10::
页:
[1]
