Results 1 to 8 of 8
  1. #1
    yuto's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    1

    Red face Fixing Legacy VB Code

    Hello! , Am a little new in visual basic, so i dont really know what am doing in first place. I usually focuse my activity on Drawing throught photoshop, but this program called visual basic caught my attention, beacouse its a programming lenguaje and the things you can do with it are almost unlimited.
    So i wanted to learn more and more about it, but i dont really understand a word and i need to do this how fast i can, so i request for your help guys, beacause this is not my department hahaha.

    My goals:
    - I did put 2 command buttoms and 1 timmer on my Form, What i want to do? I want that my 1st command buttom change its propiety to enabled with a simple key pressing (For ex: I press in my keybord SUPR, and then Inside the game it start to spamm the key U until i press the Insert key)

    Code:
    Option Explicit
    Private Sub Command1_Click()
    Timer1.Enabled = True
    End Sub
    
    Private Sub Command2_Click()
    Timer1.Enabled = False
    End Sub
    
    Private Sub Timer1_Timer()
    SendKeys ("u")
    End Sub
    
    Private Sub Form_KeyPress(KeyAscii As Integer)
    If Hotkey = 65 Then Timer1.Enabled = True                           ' I know 65 is not SUPR key, its A key      
    If Hotkey = 66 Then Timer1.Enabled = False                          ' I know 66 is not Instert key, its S key
    End Sub
    I done this, but it wont work! , Can you guys modify it By remplacing the Sendkeys for virtualkeys and make it work?

    -Goal Number 2:

    Okay, i want to fully explain the functions i want to make for this:
    I want that when you press configuration mode, it does Auto-Save the positions of the mouse by pressing F1 (by repeating this process 4 times), and when we finish of configurating this possitions i want to Auto-Click that 4 positions when i press the 0 buttom.
    and also i was thinking on adding the same feature by repeating Configuration mode steps (1,2,3) and add another 4 possition to bind to key pad 1 key.

    -Last goal, the most easly:
    How can i make that my timmers that i think they will be atleast 4 timmers,read the intervals i wrote? Like i explain in the image.


    THANKS FOR ALL MPGH community!!!

    Hope next time i could make a realease in place to request for your help!!
    Attached Thumbnails Attached Thumbnails
    helpbt.jpg  


  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Are you trying to code in Visual Basic 6?

    Quit now, move on to VB.Net.



  3. The Following User Says Thank You to Blubb1337 For This Useful Post:

    NextGen1 (02-24-2012)

  4. #3
    yuto's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by Blubb1337 View Post
    Are you trying to code in Visual Basic 6?

    Quit now, move on to VB.Net.
    Thank you for the advice!

  5. #4
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Kevin (@Blubb1337) said it right, VB6 and < has some benefits, but moving forward you may want to start dev(ing) in VS.net. Your going to have to relearn some things & learn some new things, but it's worth the time it takes.

    @yuto

    Edit: But, in the mean time, the issue is most likely that your form doesn't have proper focus, The Keypress Event for form will only work if it has no enabled controls (like your buttons) If it does, the buttons will grab focus and if that is the case the keypress event will never fire, Try Setting the KeyPreview Property for the form = true, By doing so the form will receive keystrokes before the controls do.

    Hope it helps

    Last edited by NextGen1; 02-24-2012 at 02:40 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  6. #5
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by NextGen1 View Post
    Kevin (@Blubb1337) said it right, VB6 and < has some benefits, but moving forward you may want to start dev(ing) in VS.net. Your going to have to relearn some things & learn some new things, but it's worth the time it takes.

    @yuto

    Edit: But, in the mean time, the issue is most likely that your form doesn't have proper focus, The Keypress Event for form will only work if it has no enabled controls (like your buttons) If it does, the buttons will grab focus and if that is the case the keypress event will never fire, Try Setting the KeyPreview Property for the form = true, By doing so the form will receive keystrokes before the controls do.

    Hope it helps

    where.the.fuck.do.you.come.from?




  7. The Following User Says Thank You to Blubb1337 For This Useful Post:

    [MPGH]master131 (02-25-2012)

  8. #6
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by Blubb1337 View Post
    where.the.fuck.do.you.come.from?

    @Blubb1337

    Well see, along time a go, My mother & father *(&#$&(* #$(* , well you know.

    Seriously, I stop by every now and then, but decided to post today. Don't know why, felt "compelled"


     


     


     



    The Most complete application MPGH will ever offer - 68%




  9. #7
    utherson601's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Behind Closed Doors
    Posts
    55
    Reputation
    10
    Thanks
    7
    My Mood
    Yeehaw
    doesnt the op need to define the sendkeys?
    and hook it to anouther program/proccess?
    "He who joyfully marches to music rank and file, has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice"-Eistein

  10. #8
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by utherson601 View Post
    doesnt the op need to define the sendkeys?
    and hook it to anouther program/proccess?
    Depends on what he is attempting to do, in this case, (as far as we know) his application is functional, In this particular case, he created a HotKey and has no need to hook anything, his project is already checking for keystrokes, he just needs to make sure the form catches the keystroke before the controls do (as answered above)


     


     


     



    The Most complete application MPGH will ever offer - 68%




Similar Threads

  1. [Help] fix my this code-C++ 2010
    By m987654321p in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 26
    Last Post: 04-29-2011, 10:21 AM
  2. [Help] Fix My Source Code
    By Xabder in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 29
    Last Post: 04-25-2011, 04:10 PM
  3. Error Code Pi 99999 WHat does this mean, fixes?
    By ryanrob20 in forum Combat Arms Help
    Replies: 11
    Last Post: 01-26-2010, 01:22 PM
  4. Fix for No Error Code Crashing!
    By SpaceMan in forum Combat Arms Help
    Replies: 1
    Last Post: 12-17-2009, 07:42 PM
  5. Fixing your spread/ recoil code!!
    By boom.. in forum WarRock - International Hacks
    Replies: 7
    Last Post: 06-11-2007, 10:01 AM