Trigger Bot ( Get Pixel )

Posts 1–2 of 2 · Page 1 of 1
Trigger Bot ( Get Pixel )
Note: Put this into a translator (it´s german ),
i got banned i a german forum for asking help about a bot ,
so now i switched to mpgh, thank you



Hallo, ich habe folgendes Problem:

Ich möchte für ein Spiel ein Trigger Bot erstellen. ( z.B schießt automatisch auf den Gegner falls die Maus auf ihn Zeigt )
Ich habe mir also folgendes überlegt:

• Einen Timer der immer wieder abfrägt welcher Pixel bei der Maus ist.

Code:
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _
New Drawing.Point(0, 0), BMP.Size)
Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0)
• Und einen zweiten Timer der abfrägt ob der PIxel der bei der Maus der Farbe des Hintergrundes einer PictureBox gleich sind.

Code:
If Pixel <> PictureBox1.BackColor Then
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
• Falls sie gleich sind soll die Maus einen Klick ausführen, dafür benutze ich diese Funktion:

Code:
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Ich habe das ganze dann getestet und ich habe nun diese 2 Probleme:

Die Maus drückt nur runter (also "hebt nicht mehr ab" )
Die Farbe scheint egal zu sein, obwohl der Hintergrund der PictureBox Fuchsia ist ( ich benutze einen Button mit der Farbe Fuchsia zum Testen )

Ich hoffe ihr könnt mir helfen und bedanke mich schonmal im vorraus.

triggerbot_123
wouldn't this work?

Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cbuttons As Integer, ByVal dwextrainfo As Integer)

Private Const mouseclickup = 4
Private Const mouseclickdown = 2

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
mouse_event(mouseclickup, 0, 0, 0, 0)
mouse_event(mouseclickdown, 0, 0, 0, 0)
End Sub
if Pixel <> PictureBox1.Backcolor Then
Timer1.Enabled = false
else
Timer1.Enabled = true
end if
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
Dim a As New Drawing.Bitmap(1, 1)
Dim b As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(a)
b.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), New Drawing.Point(0, 0), a.Size)
Dim c As Drawing.Color = a.GetPixel(0, 0)
PictureBox1.BackColor = c

End Sub

and the color DOES matter. i believe you're using a texture hack and not actually drawing into the game
picture 1 back color has to be the exact same color. if that is your question
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?