我做了一个自动点击器。
现在有一个问题。当我运行代码时,它可以正常工作,但是会在我全屏(在游戏中)时单击。
当我想停止它时,我在菜单栏上按了应用程序,但它始终保持打开和关闭状态。
如何分配类似F4的按钮来运行代码?我不想按开始按钮,而是要按F4键。
我可以在编程上获得更高的分数(允许我使用该网站来获得更好的分数)。
这是我的代码:
Public Class Form1
Declare Sub mouse_event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, ByVal dx As Int32, ByVal dy As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As Int32)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Label1.Text = Label1.Text + 1
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position)
mouse_event(&H2, 0, 0, 0, 1)
mouse_event(&H4, 0, 0, 0, 1)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Label1.Text = 0
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position)
mouse_event(&H2, 0, 0, 0, 1)
mouse_event(&H4, 0, 0, 0, 1)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Label1.Text = 0
End Sub
End Class