|
Thread |
Forum |
Last Post |
Posts |
Views |
 |
color "triggerbot"
Posted on: Sat 28. Jan 2012, 19:30
hollowman
Preview
Go To Post
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: Imports System.Runtime.InteropServices Public Class Form1 Public pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Public modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Public ForeColorStr As String Public model As String <DllImport("gdi32.dll")> _ Private Shared Function CreateDC( _ ByVal lpszDriver As String, _ ByVal lpszDevice As String, _ ByVal lpszOutput As String, _ ByVal lpInitData As IntPtr) As IntPtr End Function <DllImport("gdi32.dll")> _ Private Shared Function DeleteDC(ByVal hdc As IntPtr) As Boolean End Function <DllImport("gdi32.dll")> _ Private Shared Function GetPixel( _ ByVal hdc As IntPtr, _ ByVal nXPos As Integer, _ ByVal nYPos As Integer) As Integer End Function Public Function GetPixelColor(ByVal x As Integer, ByVal y As Integer) As Color Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero) Dim colorRef As Integer = GetPixel(hdcScreen, x, y) DeleteDC(hdcScreen) Return Color.FromArgb(colorRef And &HFF, _ (colorRef And &HFF00) >> 8, (colorRef And &HFF0000) >> 16) End Function 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 Public Const MOUSEEVENTF_LEFTUP = &H4 Public Sub SimulateClick() mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) 'Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor) 'Label1.Text = ForeColorStr Timer1.Enabled = False Timer2.Enabled = True End Sub Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort Public Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Dim model As String = ColorTranslator.ToHtml(modelcolor) Label2.Text = model Timer4.Enabled = True End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick If CBool(GetAsyncKeyState(Keys.F12)) Then Timer1.Enabled = True Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor) Label1.Text = ForeColorStr ' Else : Timer1.Enabled = False 'Timer2.Enabled = False End If End Sub Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick If model <> ForeColorStr Then SimulateClick() Timer2.Enabled = False Timer4.Enabled = False Else End If End Sub 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.
|
VB, C/C++, Delphi, etc |
Sun 29. Jan 2012, 15:29
by cssuchtii
|
15 |
1740 |
 |
color "triggerbot"
Posted on: Sat 28. Jan 2012, 19:30
hollowman
Preview
|
VB, C/C++, Delphi, etc |
Sun 29. Jan 2012, 15:29
by cssuchtii
|
15 |
1740 |
 |
color "triggerbot"
Posted on: Sat 28. Jan 2012, 19:30
hollowman
Preview
Go To Post
ich habe mir das jetzt so überlegt, aber es funktioniert wieder nicht TEXT Code: Imports System.Runtime.InteropServices Public Class Form1 Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort Public pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Public modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Public ForeColorStr As String Public model As String <DllImport("gdi32.dll")> _ Private Shared Function CreateDC( _ ByVal lpszDriver As String, _ ByVal lpszDevice As String, _ ByVal lpszOutput As String, _ ByVal lpInitData As IntPtr) As IntPtr End Function <DllImport("gdi32.dll")> _ Private Shared Function DeleteDC(ByVal hdc As IntPtr) As Boolean End Function <DllImport("gdi32.dll")> _ Private Shared Function GetPixel( _ ByVal hdc As IntPtr, _ ByVal nXPos As Integer, _ ByVal nYPos As Integer) As Integer End Function Public Function GetPixelColor(ByVal x As Integer, ByVal y As Integer) As Color Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero) Dim colorRef As Integer = GetPixel(hdcScreen, x, y) DeleteDC(hdcScreen) Return Color.FromArgb(colorRef And &HFF, _ (colorRef And &HFF00) >> 8, (colorRef And &HFF0000) >> 16) End Function 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 Public Const MOUSEEVENTF_LEFTUP = &H4 Public Sub SimulateClick() mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If CBool(GetAsyncKeyState(Keys.F12)) Then Dim pixColor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Dim ForeColorStr As String = ColorTranslator.ToHtml(pixColor) Label1.Text = ForeColorStr Timer3.Enabled = True Timer1.Enabled = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Do Until model <> ForeColorStr Dim modelcolor As Color = GetPixelColor(Cursor.Position.X, Cursor.Position.Y) Dim model As String = ColorTranslator.ToHtml(modelcolor) Label2.Text = model Loop SimulateClick() End Sub End Class
|
VB, C/C++, Delphi, etc |
Sun 29. Jan 2012, 15:29
by cssuchtii
|
15 |
1740 |
 |
color "triggerbot"
Posted on: Sat 28. Jan 2012, 19:30
hollowman
Preview
Go To Post
habs jetzt hinbekommen. allerdings ist das ganze im endeffekt wenig effektiv in source
|
VB, C/C++, Delphi, etc |
Sun 29. Jan 2012, 15:29
by cssuchtii
|
15 |
1740 |
 |
color "triggerbot"
Posted on: Sat 28. Jan 2012, 19:30
hollowman
Preview
Go To Post
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.
|
VB, C/C++, Delphi, etc |
Sun 29. Jan 2012, 15:29
by cssuchtii
|
15 |
1740 |