Hi Community,
ich habe einen Spamer gebstelt und wollte ihn mit Hotkeys verschönern, doch ich bekomm nun beim Debuggen einen Fehler.
Hier der Code:
PHP Code:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Interval = TextBox2.Text
My.Computer.Keyboard.SendKeys(TextBox1.Text)
My.Computer.Keyboard.SendKeys("{Enter}")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim starthotkey As Boolean
Dim stophotkey As Boolean
starthotkey = GetAsyncKeystate(Keys.F4)
stophotkey = GetAsyncKeystate(Keys.F5)
If starthotkey = True Then
'start
Timer1.Enabled = True
End If
If stophotkey = True Then
'stop
Timer1.Enabled = False
End If
End Sub
Private Declare Function GetAsyncKeystate Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Bitte um Hilfe, da ich bin noch nicht so lange im Coding-bereich.( 1-2Wochen, dafür 2 Jahre Webdesign)
Denkst du es liegt an der Gross/Kleinschreibung? Ich denke nicht, da wenn ich es gross Schreibe, also so GetAsyncKeyState wir es wieder klein also so: GetAsyncKeystate
EDIT: Was du mit den "<>" meinst, weiss ich nicht.
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
Schreib es mal so am Besten direkt unter Class..
Grundlagen^^
Ups, da fällt mir nur ein: Ui ähm ou ööö äähm ja uu öö, ach ja die Grundlagen.
Ich geh die gleich noch ein mal durch.
Edit: Hab den Code eingefügt und das Ganze sieht jetzt so aus:
PHP Code:
Public Class Form1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Interval = TextBox2.Text
My.Computer.Keyboard.SendKeys(TextBox1.Text)
My.Computer.Keyboard.SendKeys("{Enter}")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim starthotkey As Boolean
Dim stophotkey As Boolean
starthotkey = GetAsyncKeystate(Keys.F4)
stophotkey = GetAsyncKeystate(Keys.F5)
If starthotkey = True Then
'start
Timer1.Enabled = True
End If
If stophotkey = True Then
'stop
Timer1.Enabled = False
End If
End Sub
Private Declare Function GetAsyncKeystate Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Ich bekomm diesen Fehler beim drücken von F4/F5 "Ungültige Konvertierung von der Zeichenfolge in Typ Integer."
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
..
starthotkey = GetAsyncKeystate(Keys.F4)
stophotkey = GetAsyncKeystate(Keys.F5)
...
Private Declare Function GetAsyncKeystate Lib "user32" (ByVal vkey As Long) As Integer
Du hast neben deiner alten falschen/falschgeschrieben einfach die neue richtige/richtig geschriebene Funktion reinkopiert und nicht einmal den Funktionsaufruf angepasst.
Das hat was mit Logik zu tun...Wenn du immernoch die falsche Funktion verwendest brauchste dich srsly nicht wundern wenn es nicht geht...Die Richtige Zaubert wohl kaum ;o
Edit:
Wenn du es immer noch nicht verstehst =>
Quote:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
..
starthotkey = GetAsyncKeystate(Keys.F4) => GetAsyncKeyState(Keys.F4)
stophotkey = GetAsyncKeystate(Keys.F5) => GetAsyncKeyState(Keys.F5)
...
Private Declare Function GetAsyncKeystate Lib "user32" (ByVal vkey As Long) As Integer <= Löschen!
Edit²:
Du kannst das hier auch anders schreiben:
PHP Code:
Dim starthotkey As Boolean = GetAsyncKeyState(Keys.F4) Dim stophotkey As Boolean = GetAsyncKeyState(Keys.F5)
Kann mir bitte jemmand eine Hmachi HP erstellen """""SOS HELP"""" 09/15/2010 - Metin2 Private Server - 11 Replies SO wie der Titel schon sagt ich suche einen der mir per Teamviwer eine hp machen kann habe schon alles ausprobiert aber es klappt nie!!!!
PLS HELP...