Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [HELP] moving mouse

[HELP] moving mouse

Posts 1–14 of 14 · Page 1 of 1
DY
dylan40
[HELP] moving mouse
Can you guy's help me im trying to make a afk bot for ca but i have no idea how to make button1 move the coordinates of the mouse.
#1 · 16y ago
Jason
Jason
[php]

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Cursor.Position = New Point(x, y)

End Sub
[/php]

Just set the 'x' and 'y' values to the x and y co-ordinates of where you want the mouse to go.

Having trouble finding mouse coords?

create a timer of interval 1 and set it to enabled and create a label.



[php]
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Label1.Text = (Cursor.Position.X & ", " & Cursor.Position.Y)

End Sub[/php]

Hope that helps,

J-Deezy
#2 · 16y ago
DY
dylan40
Thanks..........
#3 · 16y ago
Jason
Jason
Okay for mouse click.

First declare this shizniz just under "Public Class Form1"

[php] Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4

[/php]

Then anywhere you need it to simulate a mouse click just put this

[php]
mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)
[/php]

That simulates a single click.

Just post if you need anything else (fast I'm sleeping soon :P)

EDIT: If you plan on using the mouse click in numerous places then make a sub

[php]
Private Sub MouseClick()

mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)

End Sub
[/php]

Then whenever you want to click the mouse. Just do this

[php]
Call MouseClick()
[/php]
#4 · edited 16y ago · 16y ago
DY
dylan40
Ok thanks very much add me on msn please to help me when i need it niceone61@hotmail.com
#5 · 16y ago
Jason
Jason
Quote Originally Posted by dylan40 View Post
Ok thanks very much add me on msn please to help me when i need it niceone61@hotmail.com
Just PM me here, I'm usually on MPGH when I'm on the computer so I'll see it.

Do you know how to make the person move around in CA programmatically?
#6 · 16y ago
/B
/b/oss
close this endrit?
#7 · 16y ago
Jason
Jason
Quote Originally Posted by Major_the_hacker View Post
close this endrit?
Why? It's still open for discussion.

Just because the original question was answered does not mean the thread should be closed yet, there is still active discussion going on.
#8 · 16y ago
DY
dylan40
no i dont know how to make him move but it will shot.... with auto clicker
#9 · 16y ago
Jason
Jason
Oh yeah, make sure it only shoots every now and then, otherwise you'll run outta ammo before the game ends. I was trying to make mine using "SendMessage" so you could AFK and still use your computer didn't work though cos CA patched sendmessage.
#10 · 16y ago
Hassan
Hassan
Although the problem is solved, here is a nice mouse move effect I just created. Its simple. It smoothly takes the cursor to the position you want. Not like directly jumping to the co-ordinates !!


First declare these:

[php]
'Set the x and y co-ordinates to your adjustments... In this case it will take the cursor to start menu.
Dim x As Integer = 10
Dim y As Integer = Screen.PrimaryScreen.Bounds.Height - 20
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Integer
Dim i As Integer = MousePosition.Y
Dim j As Integer = MousePosition.X
Dim boolx As Boolean = False
Dim booly As Boolean = False[/php]

Then add a timer and set its interval to 1. Then add the following code in the timer:

[php]If Not boolx Then
If x <= j Then
SetCursorPos(j, i)
j -= 4
Else
SetCursorPos(j, i)
j += 4
boolx = True

End If
End If
If Not booly Then
If y <= i Then
SetCursorPos(j, i)
i -= 4
Else
SetCursorPos(j, i)
i += 4
If boolx Then
booly = True

End If
End If
End If[/php]

Now run the application. The code might not be perfect. It needs improvement...Just posted to give you an idea.

Enjoy smooth mouse ride.
#11 · 16y ago
Jason
Jason
Quote Originally Posted by FLAMESABER View Post
Although the problem is solved, here is a nice mouse move effect I just created. Its simple. It smoothly takes the cursor to the position you want. Not like directly jumping to the co-ordinates !!


First declare these:

[php]
'Set the x and y co-ordinates to your adjustments... In this case it will take the cursor to start menu.
Dim x As Integer = 10
Dim y As Integer = Screen.PrimaryScreen.Bounds.Height - 20
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Integer
Dim i As Integer = MousePosition.Y
Dim j As Integer = MousePosition.X
Dim boolx As Boolean = False
Dim booly As Boolean = False[/php]

Then add a timer and set its interval to 1. Then add the following code in the timer:

[php]If Not boolx Then
If x <= j Then
SetCursorPos(j, i)
j -= 4
Else
SetCursorPos(j, i)
j += 4
boolx = True

End If
End If
If Not booly Then
If y <= i Then
SetCursorPos(j, i)
i -= 4
Else
SetCursorPos(j, i)
i += 4
If boolx Then
booly = True

End If
End If
End If[/php]

Now run the application. The code might not be perfect. It needs improvement...Just posted to give you an idea.

Enjoy smooth mouse ride.
I haven't tested it but this looks niiiice. Good thinking. I like it Pretty simple and understandable, why didn't I think of it
#12 · 16y ago
Blubb1337
Blubb1337
Cuz you're noob ^_____^

Naw, easy but creative thought =D
#13 · 16y ago
Jason
Jason
Quote Originally Posted by Blubb1337 View Post
Cuz you're noob ^_____^
Thanks man

I think i'm going to go cry myself to sleep now...QQ

Nah jokes :P
#14 · 16y ago
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

  • Help with Moving MouseBy flameswor10 in C++/C Programming
    8Last post 15y ago
  • Move mouse via-keyboardBy VvITylerIvV in Combat Arms Discussions
    3Last post 16y ago
  • [Help]Moving things around`By Samueldo in Visual Basic Programming
    7Last post 16y ago
  • [HELP]Fast Mouse Click[Solved]By <(-_-)> in Visual Basic Programming
    5Last post 16y ago
  • [HELP] Fast Mouse Click Code[Solved]By <(-_-)> in Visual Basic Programming
    6Last post 16y ago

Tags for this Thread

None