Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Send Input to Halo 2 Vista in C#

  1. #1

    Send Input to Halo 2 Vista in C#

    Hello, for all you C# programmers out there, ive got a question that i need answered.

    I want to stimulate the mouse and keyboard. I know a few methods to do this but for some reason, they dont seem to work while im playing h2v.

    So far, the only method that has worked is the SendKeys.Send function. unfortunately, SOMETIMES the game misses it and it ackts like if the function was never even used. I think this is becuase the function presses and lets go of the key way to fast before it evens give time for the game to detect it.

    for example, if i press SendKeys.Send("f"); the game should punch...right? well sometimes it does and sometimes it doesnt. i found out that if i do SendKeys.Send("fffffffffffffffffffffffffff"); i have a greater probability of puching, but it still isnt enough to make it punch 100% of the time.

    Is there a way to wait a while before the SendKeys.Send lets go of the button pressed? Is there a better way to send input that will work with directx games? If you have a way to do this in C++ that also works with h2v, feel free to post it also, I dont mind switching to C++ as long as it works

    all help is appreciated
    Last edited by Sprt4n117; September 12th, 2007 at 08:12 PM. Reason: I forgot to add one thing
    Reply With Quote

  2. #2
    chilango Con's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, BC, Canada
    Posts
    8,397

    Re: Send Input to Halo 2 Vista in C#

    I was using SendKeys with H2V a while ago as well, except in VB. It only seems to affect the ingame chat console if it's open. If anyone's got a better way, I'd also love to hear about it.
    Reply With Quote

  3. #3

    Re: Send Input to Halo 2 Vista in C#

    I noticed that it worked on the chat too.

    (lol, i was pretty mad and asking myself "Why the hell wont it work for gameplay!!!!?")
    Last edited by Sprt4n117; September 12th, 2007 at 09:32 PM. Reason: i forgot to end the quotes...
    Reply With Quote

  4. #4
    Senior Member Vicky's Avatar
    Join Date
    May 2007
    Location
    Up there...
    Posts
    874

    Re: Send Input to Halo 2 Vista in C#

    One question: why would you want to simulate key-pressing?
    Reply With Quote

  5. #5
    Stoopid 4 life Chromide's Avatar
    Join Date
    May 2007
    Location
    H-town Michigan
    Posts
    83

    Re: Send Input to Halo 2 Vista in C#

    Quote Originally Posted by Vicky View Post
    One question: why would you want to simulate key-pressing?
    if someone could send key strokes in game play they could simulate a bxr or what ever its called so that they get it every time with only one click. in my opinion it would be a hack but that could be one use for why someone would want to be able to.
    Reply With Quote

  6. #6

    Re: Send Input to Halo 2 Vista in C#

    Well you could always use the wait method: "SendKeys.SendWait("f");"

    Also, there is a much more effective way of sending lots of the same letter: "SendKeys.SendWait("f 100");"..with the number representing the number of repeats.

    MSDN Goes Into More Detail.
    Reply With Quote

  7. #7
    Senior Member Patrickssj6's Avatar
    Join Date
    Oct 2006
    Location
    'schland
    Posts
    3,835

    Re: Send Input to Halo 2 Vista in C#

    Don't sent the keys...let windows press it...for mouse clicks I have the source somewhere...if you do use the send key function don't forget to...

    System.Threat.Threating.Sleep(100)

    If you let the program sleep for a few milliseconds the send key function works way better
    Reply With Quote

  8. #8
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,126

    Re: Send Input to Halo 2 Vista in C#

    Quote Originally Posted by Patrickssj6 View Post

    System.Threat.Threating.Sleep(100)
    fucking system threats....
    Reply With Quote

  9. #9

    Re: Send Input to Halo 2 Vista in C#

    Quote Originally Posted by Vicky View Post
    One question: why would you want to simulate key-pressing?
    I am currently working on an app that will auto-butterfly and auto-rocket-sword-cancel
    Quote Originally Posted by Patrickssj6 View Post
    System.Threat.Threating.Sleep(100)

    If you let the program sleep for a few milliseconds the send key function works way better
    I think you mean System.Thread.Threading.Sleep(number_of_millisecon ds);

    but i have a question, what does this do? I know it stops the program from what ever its doing, but does this mean that if i use it after the SendKeys.Send() function, it will hold down the key longer before letting go?
    Quote Originally Posted by Prey View Post
    there is a much more effective way of sending lots of the same letter: "SendKeys.SendWait("f 100");"..with the number representing the number of repeats.
    I found no difference using the SendKeys.SendWait() function

    btw, you forgot the brackets...its supposed to be SendKeys.Send("{f 100}");

    Quote Originally Posted by Kornman00 View Post
    fucking system threats....
    LOL
    Reply With Quote

  10. #10
    Senior Member Vicky's Avatar
    Join Date
    May 2007
    Location
    Up there...
    Posts
    874

    Re: Send Input to Halo 2 Vista in C#

    Quote Originally Posted by Sprt4n117 View Post
    I am currently working on an app that will auto-butterfly and auto-rocket-sword-cancel
    Butterflies Rockets-swords Either i'm on the wrong drugs or do we share the same H2V?
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •