VB.net code help

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
Hello folk, i want to make a Piano bot for garry's mod but it seems not to work in game,
could someone help me with it

This is my code

C#:
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Threading.Thread.Sleep(5000)
        SendKeys.Send("{G}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{G}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{A}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{H}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{H}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{R}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{J}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{L}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{T}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{I}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{P}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{E}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{Q}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{5}")
        Threading.Thread.Sleep(200)
        SendKeys.Send("{0}")
    End Sub
End Class
 

OmegaExtern

Newbie
Full Member
Jan 19, 2014
10
169
1
Well, first post >.< mine too xD
Use C++ for much less pain in your ass.. Look at SendMessage/PostMessage, or SendInput(aka keyb_event/mouse_event) Windows APIs documentation on MSDN/pinvoke.net.
Or either use AutoIt/AutoHotkey/WinAutomation... :)
 

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
This does the job but it is pressing just 1 key

C#:
Public Class Form1

    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16

    Dim sSend As New StringSender.StringClass

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Timer1.Enabled = True
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Timer1.Enabled = False
        Application.Exit()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        If GetAsyncKeyState(Keys.F1) Then
            Threading.Thread.Sleep(2000)

            sSend.SendKey(Keys.P)
            Threading.Thread.Sleep(300)
            sSend.SendKey(Keys.O)
            Threading.Thread.Sleep(300)
            sSend.SendKey(Keys.I)

        End If

    End Sub


End Class
 
Last edited:

OmegaExtern

Newbie
Full Member
Jan 19, 2014
10
169
1
You could also use a Scripting engine that is implemented in Source Engine.. And/or combine with Lua :)
By the way, I wonder, how is this working...?
First off, why using VB6 definition (GetAsyncKeyState)?!
You defined GetAsyncKeyState(Short) : Short.
>> If GetAsyncKeyState(Keys.F1) Then
And now, you except to get boolean out of GetAsyncKeyState, and also Keys can't be assigned to Short.
You totally screwed up data types, and/or do not know what the heck you're actually doing. I recommend you to turn on option script in project settings (or put a definition for it on top of your code, before everything "Option Script On").
 
Last edited:

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
Well, first post >.< mine too xD
Use C++ for much less pain in your ass.. Look at SendMessage/PostMessage, or SendInput(aka keyb_event/mouse_event) Windows APIs documentation on MSDN/pinvoke.net.
Or either use AutoIt/AutoHotkey/WinAutomation... :)
yea but i don't know C++, i only use C# and VB.Net
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods