OldSchoolHack

Register / Login English

color "triggerbot"

icon Thread: color "triggerbot"

Join Date: May 2008

Posts: 8

ich habe mir das jetzt so überlegt, aber es funktioniert wieder nicht

TEXT Code:
  1. Imports System.Runtime.InteropServices
  2. Public Class Form1
  3. Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
  4.  
  5. Public pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  6. Public modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  7. Public ForeColorStr As String
  8. Public model As String
  9.  
  10. <DllImport("gdi32.dll")> _
  11. Private Shared Function CreateDC( _
  12. ByVal lpszDriver As String, _
  13. ByVal lpszDevice As String, _
  14. ByVal lpszOutput As String, _
  15. ByVal lpInitData As IntPtr) As IntPtr
  16. End Function
  17.  
  18. <DllImport("gdi32.dll")> _
  19. Private Shared Function DeleteDC(ByVal hdc As IntPtr) As Boolean
  20. End Function
  21.  
  22. <DllImport("gdi32.dll")> _
  23. Private Shared Function GetPixel( _
  24. ByVal hdc As IntPtr, _
  25. ByVal nXPos As Integer, _
  26. ByVal nYPos As Integer) As Integer
  27. End Function
  28.  
  29. Public Function GetPixelColor(ByVal x As Integer, ByVal y As Integer) As Color
  30. Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero)
  31. Dim colorRef As Integer = GetPixel(hdcScreen, x, y)
  32. DeleteDC(hdcScreen)
  33.  
  34. Return Color.FromArgb(colorRef And &HFF, _
  35. (colorRef And &HFF00) >> 8, (colorRef And &HFF0000) >> 16)
  36. End Function
  37.  
  38. 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)
  39.  
  40. Public Const MOUSEEVENTF_LEFTDOWN = &H2
  41. Public Const MOUSEEVENTF_LEFTUP = &H4
  42.  
  43. Public Sub SimulateClick()
  44. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  45. mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  46. End Sub
  47.  
  48.  
  49.  
  50. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  51. If CBool(GetAsyncKeyState(Keys.F12)) Then
  52.  
  53. Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  54. Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor)
  55. Label1.Text = ForeColorStr
  56.  
  57.  
  58. Timer3.Enabled = True
  59. Timer1.Enabled = False
  60.  
  61. End If
  62.  
  63. End Sub
  64.  
  65.  
  66.  
  67. Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
  68. Do Until model <> ForeColorStr
  69. Dim modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  70. Dim model As String = ColorTranslator.ToHtml(modelcolor)
  71. Label2.Text = model
  72. Loop
  73. SimulateClick()
  74. End Sub
  75. End Class