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]Whats wrong with this?

[HELP]Whats wrong with this?

Posts 1–15 of 31 · Page 1 of 3
GO
Golden.
[HELP]Whats wrong with this?
Yes its me, Golden. the noob back with another question

Whats wrong with this code?
Code:
Public Class Form1
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetAsyncKeyState(Keys.F5) Then
            Timer1.Enabled = True
        ElseIf GetAsyncKeyState(Keys.F6) Then
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If GetAsyncKeyState(Keys.F5) Then
            Timer1.Enabled = True
        ElseIf GetAsyncKeyState(Keys.F6) Then
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        If Timer1.Enabled = True Then
            Label1.Text = "AFK BOT ENABLED, PRESS F6 TO DISABLE!"
            Label1.ForeColor = Color.Green
        ElseIf Timer1.Enabled = False Then
            Label1.Text = "AFK BOT DISABLED, PRESS F5 TO ENABLE!"
            Label1.ForeColor = Color.Red

        End If
    End Sub
End Class
#1 · 16y ago
'Bruno
'Bruno
Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
#2 · 16y ago
Jason
Jason
Quote Originally Posted by Brinuz View Post
Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
As Brinuz said, logic is the main fault here, specifically:

[php]
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.F5) Then
Timer1.Enabled = True
ElseIf GetAsyncKeyState(Keys.F6) Then
Timer1.Enabled = False
End If
End Sub
[/php]

Once you've pressed F6 this timer is no longer active and therefore any code contained within it is null and void.

Create a new timer specifically for hotkeys.

i.e

[php]
Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkeys.Tick
dim Start as boolean = GetAsyncKeyState(Keys.F5)
dim Stop as Boolean = GetAsyncKeyState(Keys.F6)


If Start Then
Timer1.Enabled = True
ElseIf Stop Then
Timer1.Enabled = False
End If

End Sub
[/php]

Something like that
#3 · 16y ago
Lonely Tedy Bear
Lonely Tedy Bear
Quote Originally Posted by Brinuz View Post
Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
haha i was going to help but you got this good job =p
also i lol! so hard when i seen the hotkey in the load event
the way i do my hotkeys is set the timer to 50 interval

edit:
#4 · edited 16y ago · 16y ago
GO
Golden.
Ok, Techial helped me out over teamviewer :P
Another noob question ( i havent used VB in a month... ) whats the word for space
Because
SendKeys.Send("{Space}") is wrong.?
#5 · 16y ago
Hassan
Hassan
Quote Originally Posted by Golden. View Post
Ok, Techial helped me out over teamviewer :P
Another noob question ( i havent used VB in a month... ) whats the word for space
Because
SendKeys.Send("{Space}") is wrong.?
Code:
SendKeys.Send(" ")
#6 · 16y ago
GO
Golden.
Lol no,That prints ' Space ' as text
I Want it to press spacebar xD
#7 · 16y ago
Hassan
Hassan
Quote Originally Posted by Golden. View Post
Lol no,That prints ' Space ' as text
I Want it to press spacebar xD
Facepalm. No it just creates a space ' ' (Actually pressing the space key, not printing space).
#8 · 16y ago
GO
Golden.
Ahh
But i want it to press Space key
i understand what you are saying
But this is an Afk bot, so by pressing space it will jump :3
#9 · 16y ago
Jason
Jason
Quote Originally Posted by Golden. View Post
Ahh
But i want it to press Space key
i understand what you are saying
But this is an Afk bot, so by pressing space it will jump :3
[php]
Public Declare Function keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) As Long

Const KEYEVENTF_KEYUP = &H2
[/php]

[php]

Public Sub PressKey (ByVal tehkey as Keys)

keybd_event(tehkey, 0, 0, 0)
keybd_event(tehkey, 0, KEYEVENTF_KEYUP, 0)

End Sub

[/php]

[php]
PressKey(Keys.Space)
[/php]

There you go, completely noob proof.
#10 · 16y ago
Blubb1337
Blubb1337
Kinda the same... :

[php]#Region "Press Key"

Declare Sub keybd_event Lib "user32.dll" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)

Private Sub pk(ByVal vk As Int32) 'press key
keybd_event(vk, 0&, 0&, 0&)
keybd_event(vk, 0&, KEYEVENTF_KEYUP, 0&)
End Sub

#End Region
[/php]

[php]pk(keys.f5)[/php]

http://www.mpgh.net/forum/33-visual-...ot-code-s.html
#11 · 16y ago
GO
Golden.
J-Deezy Solved it.
Thanks man
~ Close please.
#12 · 16y ago
Jason
Jason
Quote Originally Posted by Blubb1337 View Post
Kinda the same... :

[php]#Region "Press Key"

Declare Sub keybd_event Lib "user32.dll" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)

Private Sub pk(ByVal vk As Int32) 'press key
keybd_event(vk, 0&, 0&, 0&)
keybd_event(vk, 0&, KEYEVENTF_KEYUP, 0&)
End Sub

#End Region
[/php]

[php]pk(keys.f5)[/php]

http://www.mpgh.net/forum/33-visual-...ot-code-s.html
Repeated post is repeated, nice one Kevin
#13 · 16y ago
Blubb1337
Blubb1337
I am just pointing out that this has just been posted a day ago. With a little bit of researching(Search Function) he could have found it.

+ we have a sticky about that.

= Copy Cat11!111eleven!11one!!
#14 · edited 16y ago · 16y ago
Jason
Jason
Quote Originally Posted by Blubb1337 View Post
I am just pointing out that this has just been posted a day ago. With a little bit of researching(Search Function) he could have found it.

+ we have a sticky about that.

= Copy Cat11!111eleven!11one!!
/me = original + sexy

= C+P nub.

#15 · 16y ago
Posts 1–15 of 31 · Page 1 of 3

Post a Reply

Similar Threads

  • whats wrong with this...By NetNavi in WarRock - International Hacks
    6Last post 19y ago
  • Whats wrong with this code ?By bohnenbong in WarRock - International Hacks
    7Last post 18y ago
  • whats wrong with this?By whitten in C++/C Programming
    3Last post 17y ago
  • Whats wrong with this?By superHackz in WarRock - International Hacks
    1Last post 18y ago
  • Whats wrong with this?By superHackz in Visual Basic Programming
    1Last post 18y ago

Tags for this Thread

None