Can someone help me with an auto clicker???

Discussion in 'Programming General' started by alexandr, Feb 10, 2008.

Can someone help me with an auto clicker???
  1. Unread #1 - Feb 10, 2008 at 2:29 AM
  2. alexandr
    Referrals:
    0

    alexandr Guest

    Can someone help me with an auto clicker???

    hey, iim making a program that displays the exact color and its rgb value of whatever the mouse is hovering over, i want to make it to where you type in an rgb value and the cursor goes to the nearest place with that rgb value. here is a code for moving the cursor to a specified coordinate, can i just modify it to move to rgb values insted?? cursor.position = new point (78, 90)
    thanks for anyones help!!!
     
  3. Unread #2 - Feb 10, 2008 at 4:40 AM
  4. SidStudios
    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0

    SidStudios Active Member

    Can someone help me with an auto clicker???

    Hey, I'm not sure about VB .NET but in Delphi the commands are:

    SetCursorPos(x,y)
    And
    Mouse_event(.................)

    Not sure, but I'll have to look them up, try making it in Delphi; VB .NET 2005 can be decompiled, you wouldn't want that to happen would you?
     
  5. Unread #3 - Feb 11, 2008 at 3:50 PM
  6. alexandr
    Referrals:
    0

    alexandr Guest

    Can someone help me with an auto clicker???

    i have the code in vb.net to move the cursor, its
    cursor.position = new point (x, y)
    but wat i want to do is instead of using x,y coordinates , i would like it to be rgb values
     
  7. Unread #4 - Feb 11, 2008 at 7:37 PM
  8. hmm
    Joined:
    Jan 21, 2007
    Posts:
    181
    Referrals:
    2
    Sythe Gold:
    5

    hmm Active Member

    Can someone help me with an auto clicker???

    tired of seeing people post about using other languages other than the one the person is asking about...
    program being decompiled, who cares? if we were making some uber clone of adobe cs3 and wanted to sell it, maybe, but we're not..

    people need to help with the language one needs help with or stfu..

    [/end of bitching]
     
  9. Unread #5 - Feb 12, 2008 at 3:17 PM
  10. alexandr
    Referrals:
    0

    alexandr Guest

    Can someone help me with an auto clicker???

    i know how to move the cursor, and how to make it click, i want to move it to an rgb color value instead of xy mouse coordinates.
     
  11. Unread #6 - Feb 18, 2008 at 5:12 PM
  12. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Can someone help me with an auto clicker???

    Ive tried
    Code:
    cursor.position = new point (RGB(255,0,0),RGB(255,0,0))
    that shud work but it doesnt..

    Got a new code use do loop until statements
    use slashshots find color or w/e
    Code:
     Private Sub KryptonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click
            timer1.start()
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If PictureBox2.BackColor = PictureBox1.BackColor Then
                'What ever you want it to do
            Else
                Cursor.Position = New Point(MousePosition.X + 1, MousePosition.Y)
                If MousePosition.X = Screen.PrimaryScreen.Bounds.Width Then
                    Cursor.Position = New Point(MousePosition.X - Screen.PrimaryScreen.Bounds.Width, MousePosition.Y + 1)
                ElseIf MousePosition.Y = Screen.PrimaryScreen.Bounds.Height Then
                    MsgBox("The chose color was not found")
                End If
            End If
        End Sub
    
        Private Function findColor(ByVal Color As Color, ByVal Area As Rectangle) As Point
            Dim AreaSize As Size = Area.Size
            Dim TempBitmap As New Bitmap(AreaSize.Width, AreaSize.Height)
            Graphics.FromImage(TempBitmap).CopyFromScreen(Area.Location, New Point(), AreaSize)
            For x As Integer = 0 To Area.Height - 1
                For y As Integer = 0 To Area.Width - 1
                    If TempBitmap.GetPixel(x, y) = Color Then Return New Point(Area.X + x, Area.Y + y)
                Next
            Next
            Return New Point(-1, -1)
        End Function
    
        Private Sub KryptonButton2_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles KryptonButton2.MouseUp
            Dim TempBitmap As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
            Graphics.FromImage(TempBitmap).CopyFromScreen(Screen.PrimaryScreen.Bounds.Location, New Point(), Screen.PrimaryScreen.Bounds.Size)
            PictureBox1.BackColor = TempBitmap.GetPixel(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y)
            KryptonButton1.Enabled = True
        End Sub
    K i edit it heres my code... i dont have any hot keys yet maybe l8tr
    NOTE: ignore KRYPTON it is a visual style basically (not free i have trial, its really good ^_^)

    Code:
    Private Sub KryptonButton2_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles KryptonButton2.MouseUp
            Dim TempBitmap As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
            Graphics.FromImage(TempBitmap).CopyFromScreen(Screen.PrimaryScreen.Bounds.Location, New Point(), Screen.PrimaryScreen.Bounds.Size)
            PictureBox1.BackColor = TempBitmap.GetPixel(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y)
            'My button is disabled so you cant click it if color is not selected..
            KryptonButton1.Enabled = True
        End Sub
    that gets the color chosen... heres the function needed

    Code:
     Private Function findColor(ByVal Color As Color, ByVal Area As Rectangle) As Point
            Dim AreaSize As Size = Area.Size
            Dim TempBitmap As New Bitmap(AreaSize.Width, AreaSize.Height)
            Graphics.FromImage(TempBitmap).CopyFromScreen(Area.Location, New Point(), AreaSize)
            For x As Integer = 0 To Area.Height - 1
                For y As Integer = 0 To Area.Width - 1
                    If TempBitmap.GetPixel(x, y) = Color Then Return New Point(Area.X + x, Area.Y + y)
                Next
            Next
            Return New Point(-1, -1)
        End Function
    heres what hapenes wen ur timers enabled

    Code:
    If PictureBox2.BackColor = PictureBox1.BackColor Then
                'What ever you want it to do
            Else
                Cursor.Position = New Point(MousePosition.X + 1, MousePosition.Y)
                If MousePosition.X = Screen.PrimaryScreen.Bounds.Width Then
                    Cursor.Position = New Point(MousePosition.X - Screen.PrimaryScreen.Bounds.Width, MousePosition.Y + 1)
                ElseIf MousePosition.Y = Screen.PrimaryScreen.Bounds.Height Then
                    MsgBox("The chose color was not found")
                End If
            End If
    then make a start button and add this

    Code:
    timer1.start()
     
< C++ Random Prevention | Molecular changes little impact doctors nationally higher. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site