OldSchoolHack

Register / Login English

color "triggerbot"


icon color "triggerbot" #1

Join Date: May 2008

Posts: 8

Hallom,

Ich habe versucht mit meinen VB Skillz eine Art Triggerbot zu basteln, welcher mit den Farben der Pixel arbeitet. Jedoch bekomme ich das nicht so ganz hin.
Die Farben werden zwar ausgelesen, aber entweder schiesst der Bot wie verrückt oder garnicht .

TEXT Code:
  1. Imports System.Runtime.InteropServices
  2.  
  3. Public Class Form1
  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.  
  11.  
  12. <DllImport("gdi32.dll")> _
  13. Private Shared Function CreateDC( _
  14. ByVal lpszDriver As String, _
  15. ByVal lpszDevice As String, _
  16. ByVal lpszOutput As String, _
  17. ByVal lpInitData As IntPtr) As IntPtr
  18. End Function
  19.  
  20. <DllImport("gdi32.dll")> _
  21. Private Shared Function DeleteDC(ByVal hdc As IntPtr) As Boolean
  22. End Function
  23.  
  24. <DllImport("gdi32.dll")> _
  25. Private Shared Function GetPixel( _
  26. ByVal hdc As IntPtr, _
  27. ByVal nXPos As Integer, _
  28. ByVal nYPos As Integer) As Integer
  29. End Function
  30.  
  31. Public Function GetPixelColor(ByVal x As Integer, ByVal y As Integer) As Color
  32. Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero)
  33. Dim colorRef As Integer = GetPixel(hdcScreen, x, y)
  34. DeleteDC(hdcScreen)
  35.  
  36. Return Color.FromArgb(colorRef And &HFF, _
  37. (colorRef And &HFF00) >> 8, (colorRef And &HFF0000) >> 16)
  38. End Function
  39.  
  40. 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)
  41.  
  42. Public Const MOUSEEVENTF_LEFTDOWN = &H2
  43. Public Const MOUSEEVENTF_LEFTUP = &H4
  44.  
  45. Public Sub SimulateClick()
  46. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  47. mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  48. End Sub
  49.  
  50.  
  51. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  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. Timer1.Enabled = False
  57. Timer2.Enabled = True
  58.  
  59.  
  60. End Sub
  61.  
  62. Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
  63.  
  64.  
  65.  
  66.  
  67.  
  68. Public Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  69.  
  70.  
  71. Dim modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  72. Dim model As String = ColorTranslator.ToHtml(modelcolor)
  73. Label2.Text = model
  74. Timer4.Enabled = True
  75.  
  76.  
  77.  
  78.  
  79. End Sub
  80.  
  81. Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
  82. If CBool(GetAsyncKeyState(Keys.F12)) Then
  83. Timer1.Enabled = True
  84. Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  85. Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor)
  86. Label1.Text = ForeColorStr
  87.  
  88.  
  89.  
  90. ' Else : Timer1.Enabled = False
  91. 'Timer2.Enabled = False
  92. End If
  93. End Sub
  94.  
  95. Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
  96.  
  97. If model <> ForeColorStr Then
  98. SimulateClick()
  99. Timer2.Enabled = False
  100. Timer4.Enabled = False
  101.  
  102. Else
  103.  
  104.  
  105.  
  106. End If
  107.  
  108.  
  109. End Sub
  110. End Class

Das ganze soll so funktionieren:
1. Sobald F12 gedrückt wird, wird die Hintergrundfarbe gespeichert (nun muss man leider stillhalten=
2. Wenn sich der anvisierte Pixel nun verändert, also wenn ein Gegner in das Fadenkreuz springt --> Schuss.

Optimal wäre es, wenn man die Taste gedrückt halten müsste.

icon #2

Join Date: Jun 2010

Posts: 561

VB Code:
  1. Imports System.Runtime.InteropServices
  2.  
  3. Public Class Form1
  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.  
  11.  
  12. <DllImport("gdi32.dll")> _
  13. Private Shared Function CreateDC( _
  14. ByVal lpszDriver As String, _
  15. ByVal lpszDevice As String, _
  16. ByVal lpszOutput As String, _
  17. ByVal lpInitData As IntPtr) As IntPtr
  18. End Function
  19.  
  20. <DllImport("gdi32.dll")> _
  21. Private Shared Function DeleteDC(ByVal hdc As IntPtr) As Boolean
  22. End Function
  23.  
  24. <DllImport("gdi32.dll")> _
  25. Private Shared Function GetPixel( _
  26. ByVal hdc As IntPtr, _
  27. ByVal nXPos As Integer, _
  28. ByVal nYPos As Integer) As Integer
  29. End Function
  30.  
  31. Public Function GetPixelColor(ByVal x As Integer, ByVal y As Integer) As Color
  32. Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero)
  33. Dim colorRef As Integer = GetPixel(hdcScreen, x, y)
  34. DeleteDC(hdcScreen)
  35.  
  36. Return Color.FromArgb(colorRef And &HFF, _
  37. (colorRef And &HFF00) >> 8, (colorRef And &HFF0000) >> 16)
  38. End Function
  39.  
  40. 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)
  41.  
  42. Public Const MOUSEEVENTF_LEFTDOWN = &H2
  43. Public Const MOUSEEVENTF_LEFTUP = &H4
  44.  
  45. Public Sub SimulateClick()
  46. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  47. mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  48. End Sub
  49.  
  50.  
  51. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  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. Timer1.Enabled = False
  57. Timer2.Enabled = True
  58.  
  59.  
  60. End Sub
  61.  
  62. Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
  63.  
  64.  
  65.  
  66.  
  67.  
  68. Public Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  69.  
  70.  
  71. Dim modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  72. Dim model As String = ColorTranslator.ToHtml(modelcolor)
  73. Label2.Text = model
  74. Timer4.Enabled = True
  75.  
  76.  
  77.  
  78.  
  79. End Sub
  80.  
  81. Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
  82. If CBool(GetAsyncKeyState(Keys.F12)) Then
  83. Timer1.Enabled = True
  84. Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y)
  85. Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor)
  86. Label1.Text = ForeColorStr
  87.  
  88.  
  89.  
  90. ' Else : Timer1.Enabled = False
  91. 'Timer2.Enabled = False
  92. End If
  93. End Sub
  94.  
  95. Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
  96.  
  97. If model <> ForeColorStr Then
  98. SimulateClick()
  99. Timer2.Enabled = False
  100. Timer4.Enabled = False
  101.  
  102. Else
  103.  
  104.  
  105.  
  106. End If
  107.  
  108.  
  109. End Sub
  110. End Class

habs mal kurz in die VB tags gesetzt, weil cihs so unübersichtlich fand


Achja ich würde das alles in ner Do Loop Schleife machen, ist deutlich schneller und übersichtlicher
icon #3

Join Date: May 2008

Posts: 8

ok danke werde ich mal probieren..
icon #4

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
icon #5

Join Date: Jun 2010

Posts: 561

Was machst du eigentlich mit den ganzen Timer
icon #6

Join Date: Jan 2011

Posts: 12

Erwartest du jetzt das wir deinen Code debuggen oder was?

Musst schon genauer werden was nicht funktioniert, aber sicher ned einfach ganze source posten und sagen es funktioniert nicht^^

icon #7

Join Date: May 2008

Posts: 8

habs jetzt hinbekommen. allerdings ist das ganze im endeffekt wenig effektiv in source
icon #8

Join Date: Jun 2010

Posts: 561

Ich hätte das mithilfe von Chams gelöst, da ists dann ne eindeutige Pixelfarbe vom Gegner...
Das würde ohne Probleme gehen
icon #9

Join Date: May 2008

Posts: 8

das ist mir klar, aber auf zblock servern funktioniert das ganze dann nicht.
Mal eine Frage. Die Methode ist ja für jedes AC proof? Also so gar League ACs oder?


Ist es möglich den Code so umzuschreiben, dass die Aktion nur passiert solange die Taste gedrückt gehalten wird?
Desweiteren frag ich mich ob es eine andere Methode für die Pixelfarbe gibt, welche auch im Vollbild funktioniert.
icon #10

Join Date: Jun 2010

Posts: 561

was funktioniert auf zBlock nicht? Ich mein keine Materials, Chams von  OSH
icon #11

Join Date: May 2008

Posts: 8

ja gut zblock läuft aber ich hatte vor das ding in der 4pl awp ladder zu verwenden. proof sollte es doch sein?

icon #12

Join Date: Jun 2011

Posts: 490

User-Rating:

12 positive
0 negative
Die ganze Methode ist meiner Meinung nach eher unbrauchbar in Source. Wenn man einen color trigger will musste schon mit chams oder so arbeiten, was eben ligen mäßig schlecht ist

__________________

http://www10.pic-upload.de/30.04.12/j9dbc34bxdg.jpg
icon #13

Join Date: May 2008

Posts: 8

naja ich hab ihn jetzt mal weng ausprobiert und als "reinlauf bot" ist er eig ganz witzig. z.b. auf prodigy oder d2 mit awp.

proof sollte er ja überall sein? injected ja nix etc
icon #14

Join Date: Jun 2010

Posts: 561

ja müsste eigentlich proof sein. Aber wirklich praktisch ist er nicht^^
icon #15

Join Date: May 2008

Posts: 8

gibts ne andere pixelcolor methode die auch im vollbild funktioniert?
icon #16

Join Date: Jun 2010

Posts: 561

Soweit ich weiß nicht