okay but hows this code i only get one error plz help
[php]
Imports System.Drawing
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents Start As System.Windows.Forms.Button
Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents lfred As System.Windows.Forms.Label
Friend WithEvents lfgreen As System.Windows.Forms.Label
Friend WithEvents lfblue As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtInterval As System.Windows.Forms.TextBox
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents txtX As System.Windows.Forms.TextBox
Friend WithEvents txtY As System.Windows.Forms.TextBox
Friend WithEvents lsred As System.Windows.Forms.Label
Friend WithEvents lsgreen As System.Windows.Forms.Label
Friend WithEvents lsblue As System.Windows.Forms.Label
Friend WithEvents PickColor As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Public Declare Auto Function SetCursorPos Lib "User32.dll" (ByVal X As Integer, ByVal Y As Integer) As Long
Public Declare Auto Function GetCursorPos Lib "User32.dll" (ByRef lpPoint As Point) As Long
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Public Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Public Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down
Public Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up
Public Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down
Public Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up
Dim WithEvents Tmr As New Timer
Dim Bmp As New Bitmap(1, 1)
Dim G As Graphics = Graphics.FromImage(Bmp)
Dim X As Integer
Dim Y As Integer
Dim Red As Integer
Dim Green As Integer
Dim Blue As Integer
Dim Px As System.Drawing.Color
Const Tolerance As Integer = 10
Sub New()
MyBase.New()
Me.components = New System.ComponentModel.Container
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.Start = New System.Windows.Forms.Button
Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
Me.Label1 = New System.Windows.Forms.Label
Me.lfred = New System.Windows.Forms.Label
Me.lfgreen = New System.Windows.Forms.Label
Me.lfblue = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.Label8 = New System.Windows.Forms.Label
Me.Label9 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.txtInterval = New System.Windows.Forms.TextBox
Me.Label10 = New System.Windows.Forms.Label
Me.Label11 = New System.Windows.Forms.Label
Me.txtX = New System.Windows.Forms.TextBox
Me.txtY = New System.Windows.Forms.TextBox
Me.lsred = New System.Windows.Forms.Label
Me.lsgreen = New System.Windows.Forms.Label
Me.lsblue = New System.Windows.Forms.Label
Me.PickColor = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Start
'
Me.Start.Location = New System.Drawing.Point(15, 203)
Me.Start.Name = "Start"
Me.Start.Size = New System.Drawing.Size(265, 42)
Me.Start.TabIndex = 0
Me.Start.Text = "Start"
Me.Start.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 39)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(48, 17)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Found"
'
'lfred
'
Me.lfred.AutoSize = True
Me.lfred.Location = New System.Drawing.Point(124, 39)
Me.lfred.Name = "lfred"
Me.lfred.Size = New System.Drawing.Size(24, 17)
Me.lfred.TabIndex = 4
Me.lfred.Text = "FF"
'
'lfgreen
'
Me.lfgreen.AutoSize = True
Me.lfgreen.Location = New System.Drawing.Point(185, 39)
Me.lfgreen.Name = "lfgreen"
Me.lfgreen.Size = New System.Drawing.Size(24, 17)
Me.lfgreen.TabIndex = 5
Me.lfgreen.Text = "FF"
'
'lfblue
'
Me.lfblue.AutoSize = True
Me.lfblue.Location = New System.Drawing.Point(242, 39)
Me.lfblue.Name = "lfblue"
Me.lfblue.Size = New System.Drawing.Size(24, 17)
Me.lfblue.TabIndex = 6
Me.lfblue.Text = "FF"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(120, 18)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(34, 17)
Me.Label7.TabIndex = 7
Me.Label7.Text = "Red"
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Location = New System.Drawing.Point(177, 18)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(48, 17)
Me.Label8.TabIndex = 8
Me.Label8.Text = "Green"
'
'Label9
'
Me.Label9.AutoSize = True
Me.Label9.Location = New System.Drawing.Point(237, 18)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(36, 17)
Me.Label9.TabIndex = 9
Me.Label9.Text = "Blue"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(12, 66)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(83, 17)
Me.Label2.TabIndex = 10
Me.Label2.Text = "Looking For"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(14, 96)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(54, 17)
Me.Label3.TabIndex = 14
Me.Label3.Text = "Interval"
'
'txtInterval
'
Me.txtInterval.Location = New System.Drawing.Point(127, 96)
Me.txtInterval.Name = "txtInterval"
Me.txtInterval.Size = New System.Drawing.Size(77, 22)
Me.txtInterval.TabIndex = 15
Me.txtInterval.Text = "500"
'
'Label10
'
Me.Label10.AutoSize = True
Me.Label10.Location = New System.Drawing.Point(25, 131)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(17, 17)
Me.Label10.TabIndex = 16
Me.Label10.Text = "X"
'
'Label11
'
Me.Label11.AutoSize = True
Me.Label11.Location = New System.Drawing.Point(149, 131)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(17, 17)
Me.Label11.TabIndex = 17
Me.Label11.Text = "Y"
'
'txtX
'
Me.txtX.Location = New System.Drawing.Point(48, 128)
Me.txtX.Name = "txtX"
Me.txtX.Size = New System.Drawing.Size(77, 22)
Me.txtX.TabIndex = 18
Me.txtX.Text = "500"
'
'txtY
'
Me.txtY.Location = New System.Drawing.Point(180, 128)
Me.txtY.Name = "txtY"
Me.txtY.Size = New System.Drawing.Size(92, 22)
Me.txtY.TabIndex = 19
Me.txtY.Text = "500"
'
'lsred
'
Me.lsred.AutoSize = True
Me.lsred.Location = New System.Drawing.Point(124, 66)
Me.lsred.Name = "lsred"
Me.lsred.Size = New System.Drawing.Size(24, 17)
Me.lsred.TabIndex = 20
Me.lsred.Text = "FF"
'
'lsgreen
'
Me.lsgreen.AutoSize = True
Me.lsgreen.Location = New System.Drawing.Point(185, 66)
Me.lsgreen.Name = "lsgreen"
Me.lsgreen.Size = New System.Drawing.Size(24, 17)
Me.lsgreen.TabIndex = 21
Me.lsgreen.Text = "FF"
'
'lsblue
'
Me.lsblue.AutoSize = True
Me.lsblue.Location = New System.Drawing.Point(242, 66)
Me.lsblue.Name = "lsblue"
Me.lsblue.Size = New System.Drawing.Size(24, 17)
Me.lsblue.TabIndex = 22
Me.lsblue.Text = "FF"
'
'PickColor
'
Me.PickColor.Location = New System.Drawing.Point(15, 156)
Me.PickColor.Name = "PickColor"
Me.PickColor.Size = New System.Drawing.Size(265, 42)
Me.PickColor.TabIndex = 23
Me.PickColor.Text = "Pick Color"
Me.PickColor.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(20, 254)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(252, 29)
Me.Button1.TabIndex = 24
Me.Button1.Text = "Go to Position"
Me.Button1.UseVisualStyleBackColor = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 296)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.PickColor)
Me.Controls.Add(Me.lsblue)
Me.Controls.Add(Me.lsgreen)
Me.Controls.Add(Me.lsred)
Me.Controls.Add(Me.txtY)
Me.Controls.Add(Me.txtX)
Me.Controls.Add(Me.Label11)
Me.Controls.Add(Me.Label10)
Me.Controls.Add(Me.txtInterval)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.lfblue)
Me.Controls.Add(Me.lfgreen)
Me.Controls.Add(Me.lfred)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Start)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private Sub Tmr_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Tmr.Tick
'G.CopyFromScreen(MousePosition, New Point(0, 0), Bmp.Size)
G.CopyFromScreen(New Point(X, Y), New Point(0, 0), Bmp.Size)
Px = Bmp.GetPixel(0, 0)
lfred.Text = Hex(Px.R)
lfgreen.Text = Hex(Px.G)
lfblue.Text = Hex(Px.B)
Me.Text = MousePosition().ToString
If (Px.R >= Red - Tolerance) And (Px.R <= Red + Tolerance) Then
If (Px.G >= Green - Tolerance) And (Px.G <= Green + Tolerance) Then
If (Px.B >= Blue - Tolerance) And (Px.B <= Blue + Tolerance) Then
SetCursorPos(X, Y)
Lef***ick()
End If
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
X = txtX.Text
Y = txtY.Text
Tmr.Interval = txtInterval.Text
End Sub
Public Sub Lef***ick()
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Public Sub Right_Click()
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
End Sub
Public Sub Middle_Click()
mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0)
End Sub
Private Sub PickColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PickColor.Click
If ColorDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Red = ColorDialog1.Color.R
Blue = ColorDialog1.Color.B
Green = ColorDialog1.Color.G
lsred.Text = Hex(Red)
lsblue.Text = Hex(Blue)
lsgreen.Text = Hex(Green)
End If
End Sub
Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start.Click
X = txtX.Text
Y = txtY.Text
Tmr.Interval = txtInterval.Text
Tmr.Enabled = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SetCursorPos(X, Y)
End Sub
End Class
[/php]