Need help with a few lines of code (VB6)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Evolution445
    New Member
    • Jul 2007
    • 63

    #1

    Need help with a few lines of code (VB6)

    I'm making an Automessager for a game, so I made the form with its nessesary buttons and textboxes. So now I want the program to attach to the game itself, I thought using CurrentProcess = " " but it doesnt seem to work, or the other code in the timer is wrong.

    In the program a user can write a message from a textbox to a listbox, all works fine. But once in the game, I want a timer to press T, wait 50 milliseconds, read the first message from the listbox and write it to the game, wait another 50 milliseconds and then press Enter. After the interval of about 5 minutes, I want it to read the next message and do the same thing, and when all the messages are written, to start at the top of the listbox again.

    Could anyone explain me how this is done ? I think I got the pressing of the buttons right:

    strKey = "{vbKeyT}"
    SendKeys strKey

    strKey = "{vbKeyRetu rn}"
    SendKeys strKey

    But I just don't seem to figure out how the rest goes.

    For the interval a user can set the amount of minutes the timer has to wait.

    Timer1.Interval = Text1.Text * 60000

    Is this right, or if not, could anyone help me getting this timer right?
    Thanks in advance,
    Evolution445
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by Evolution445
    For the interval a user can set the amount of minutes the timer has to wait.

    Timer1.Interval = Text1.Text * 60000

    Is this right, or if not, could anyone help me getting this timer right?
    Thanks in advance,
    Evolution445

    better you can try this

    Code:
    Timer1.Interval = val(Text1.Text) * 60000

    Comment

    • Evolution445
      New Member
      • Jul 2007
      • 63

      #3
      That solved 1 problem. :)
      Now I need to know how it can attach to the game, write messages from the listbox to the game when it has pressed T, and after that press Enter.

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by Evolution445
        write messages from the listbox to the game when it has pressed T, and after that press Enter.

        can you explain little bit more?

        Comment

        Working...