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] Mouse button

[Help] Mouse button

Posts 1–15 of 21 · Page 1 of 2
Maniac101
Maniac101
[Help] Mouse button
ok i want to create a loop that when a button or hotkey is pressed it will...
when you press and hold the mouse button instead of single clicking it will send the button ever x amount of secs

example.. in autohotkey i have a rapid fire script that looks like this
[PHP]Ins::Suspend
LButton::
Loop
{
SetMouseDelay 15
Click
If (GetKeyState("LButton","P")=0)
Break
}

[/PHP]
which is what im looking to put into a loop i know it in ahk but not in vb any idea what i need to do
#1 · 16y ago
Imported
Imported
what do you mean exactly? Do you want it to continually click for a certain amount of seconds or what? Sorry I didn't understand you properly.
#2 · 16y ago
Maniac101
Maniac101
sorry kind of hard to explain ok in the script i have when you use say the fal in mw2 and you click and hold the fire button it make the fal full auto by sending the fire button repeatedly and i want to code that in vb not sure how

that help any?

p.s. congratz on 1337
#3 · 16y ago
Imported
Imported
Quote Originally Posted by Maniac101 View Post
sorry kind of hard to explain ok in the script i have when you use say the fal in mw2 and you click and hold the fire button it make the fal full auto by sending the fire button repeatedly and i want to code that in vb not sure how

that help any?

p.s. congratz on 1337
Hmm do you want it to just hold down the Lbutton for a period of time or does it have to click over and over?

either way you need these declarations and constants

[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 LButtonDown = &H2
Private Const LButtonUp = &H4
[/php]

Okay for repeated clicking,

[php]
Do until (make an exit statement here, could be a hotkey or anything)

mouse_event(LButtonDown, 0, 0, 0, 0)
mouse_event(LbuttonUp, 0, 0, 0, 0)

Loop
[/php]

To hold it down

[php]

mouse_event(LButtonDown, 0, 0, 0, 0)

Do until (exit statement here)
System.Threading.Thread.Sleep(1)
Loop

mouse_event(LButtonUp, 0, 0, 0, 0)

[/php]

either of those help you?
#4 · 16y ago
Maniac101
Maniac101
ill fiddle with it later on looks like thats what i need ill report back on results or issues once again

sir rock
#5 · 16y ago
DE
Devient_
what
hes j-D?
#6 · 16y ago
Imported
Imported
Quote Originally Posted by Devient_ View Post
what
hes j-D?
Yes, I'm "J-Derry" you got trolled.
#7 · 16y ago
Blubb1337
Blubb1337
[php]private sub RapidFire(Byval sleeptime as integer)
Do while getasynckeystate(LButtonDown) ' = True

mouse_event(LButtonDown, 0, 0, 0, 0)
mouse_event(LbuttonUp, 0, 0, 0, 0)
threading.thread.sleep(sleeptime)

loop
end sub[/php]

[php]RapidFire(15)[/php]

This will click the left mousebutton and wait 15 miliseconds.

Should work =/
#8 · 16y ago
Maniac101
Maniac101
do i use this with nextgens keyboard hook?
#9 · 16y ago
Blubb1337
Blubb1337
No. You only need the following:

[php] Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16

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 LButtonDown = &H2
Private Const LButtonUp = &H4
[/php]
#10 · 16y ago
DE
Devient_
ive been trolled :O
#11 · 16y ago
Imported
Imported
Quote Originally Posted by Blubb1337 View Post
No. You only need the following:

[php] Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16

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 LButtonDown = &H2
Private Const LButtonUp = &H4
[/php]
Copy and pasted my constants nub
#12 · 16y ago
Maniac101
Maniac101
Quote Originally Posted by Blubb1337 View Post
No. You only need the following:

[php] Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16

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 LButtonDown = &H2
Private Const LButtonUp = &H4
[/php]
... thats where i went wrong i declared it wrong i knew i seen it before but when i typed it out i missed some lol thanks bud

i already had them i just declared that getasynckeystate wrong NUB lol jk

<----- is the nub in this matter
#13 · edited 16y ago · 16y ago
NextGen1
NextGen1
To make life easier, everyone should use the low level keyboard and mouse module
#14 · 16y ago
Blubb1337
Blubb1337
Quote Originally Posted by Imported View Post


Copy and pasted my constants nub
The constants are always the same nub!
#15 · 16y ago
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Similar Threads

  • [Help] Mouse HotkeysBy ilovepie21 in Visual Basic Programming
    1Last post 18y ago
  • [Help]Mouse Position coordinatesBy Unkn0wn_h4cker in Visual Basic Programming
    9Last post 16y ago
  • [Help]Record Button Down LengthBy ppl2pass in Visual Basic Programming
    10Last post 16y ago
  • [Help] Binding button to textboxBy Archangel in Visual Basic Programming
    2Last post 16y ago
  • [Help]Change Button Text[Solved]By [PA]nts in Visual Basic Programming
    7Last post 16y ago

Tags for this Thread

None