Results 1 to 12 of 12
  1. #1
    qwertySkill's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    My Mood
    Angelic

    My macro types to fast for the game to pick up

    I have an auto typer that works in game. It works fine in notepad but in game it only gets the first sentence because it goes by so fast. I remember a while ago there was something you put before the sendkeys that made it wait for everything to catch up, what was that? Or if I'm just hallucinating what's something that works like that?

    I only have one problem reaming:
    SendKeys.SendWait("+{enter}") is supposed to replicate a shift and enter press. it only replicates an enter
    Last edited by qwertySkill; 12-29-2012 at 04:29 PM.

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    I think Sendkeys.SendWAIT() will "wait for the program to process the keystrokes"

    Try SendWait()

    not sure what you mean about {+Enter} -- you're hardcoding in the SendKeys.Send"{enter}" right? Where could the + be coming from? Do you have a private function to convert chars to keys or something? It's weird for the '+' to just show up
    Last edited by abuckau907; 12-29-2012 at 06:14 AM.

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

    qwertySkill (12-29-2012)

  4. #3
    rileyjstrickland's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Florida
    Posts
    649
    Reputation
    90
    Thanks
    4,008
    My Mood
    Relaxed
    Quote Originally Posted by abuckau907 View Post
    I think Sendkeys.SendWAIT() will "wait for the program to process the keystrokes"

    Try SendWait()

    not sure what you mean about {+Enter} -- you're hardcoding in the SendKeys.Send"{enter}" right? Where could the + be coming from? Do you have a private function to convert chars to keys or something? It's weird for the '+' to just show up
    Worse case scenerio use this as-well
    Code:
    SendKeys.Flush

    If You Like My Releases, Hit The Thanks button!
    Follow the rules.

    Successful Purchases: 2
    @The403
    @sundy42
    Successful Sales: 1
    @wZ. Gali
    Scammed: 1

    Favorite Quotes:
    Quote Originally Posted by Doc View Post
    Who cares about simplified mandarin. The only problem here is that Cantonese (and Hokkien) is no longer being taught, but guess what, times change. There have been thousands of languages that have been lost to the ages, you'd be pissing in the wind to try and stop that.

  5. The Following User Says Thank You to rileyjstrickland For This Useful Post:

    qwertySkill (12-29-2012)

  6. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    @riley Are you talking to me...? (Why quote me) edit* nvm- plz don't make post just to reply to me..

    https://bytes.com/topic/visual-basic-...nding-sendkeys
    apparently you can't just SendKeys() with ANY text..certain characters, like the + symbol, need to have "{ }" brackets around them.
    /quote Shiva @ bytes.com
    Code:
    <mdsn>
    The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses
    () have special meanings to SendKeys. To specify one of these characters,
    enclose it within braces ({}). For example, to specify the plus sign, use
    "{+}". To specify brace characters, use "{{}" and "{}}". Brackets ([ ]) have
    no special meaning to SendKeys, but you must enclose them in braces.
    </msdn>
    ^^ I was playing around with it and kept getting errors on left-parenthesis "(" ..same thing I guess

    Why do you need to send so much text lol?

    +be careful not to do this in game chat, talking too fast might not get flagged, but people will notice if you type 200 wpm.
    maybe try controlling how big of text you put into SendKeys()? Maybe limit it to 200 or something even smaller? If that can work for you? Break it into smaller chunks and SendKeys() each chunk.

    something like
    Code:
    Public Sub SendTextGoGame(ByVal msg As String)
            AppActivate("New Text Document - Notepad")
            Dim _sb As New System.Text.StringBuilder(msg)
            Dim _tmpStr As String = ""
            If msg.Length > 10 Then
                'break it into chunks
                Do Until _sb.Length <= 10
                    _tmpStr = Mid(_sb.ToString, 1, 10)
                    SendKeys.SendWait(_tmpStr)
                    _sb.Remove(0, 10)
                    Threading.Thread.Sleep(2500)
                Loop
                If _sb.Length > 0 Then
                    'send last remaining piece
                    SendKeys.SendWait(_sb.ToString)
                 End If
            Else
                'send 1 little piece
                SendKeys.Send(msg)
               End If
        End Sub
    ''stringbuilder probably isn't more efficient when used this way. .Remove() was nice. Mid() could work just as well.
    ^^ofc change the hardcoded 10's and remove the .Sleep(), etc. it's *just an example!*


    so, is that the problem? you're trying to send text which contains chars like + ( [ + % etc?
    Last edited by abuckau907; 12-29-2012 at 01:48 PM.

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

    qwertySkill (12-29-2012)

  8. #5
    qwertySkill's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    My Mood
    Angelic
    @abuckau907 you editted your post right after I sent this haha. I tried what you had with the + but it didn't work. I remember reading somewhere that you have to have the + right before the thing, not in brackets. I tried both {+}{enter} and {+enter}, neither of them worked. However right now +{enter} works, but it rarely does so.
    Code:
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("      GGGGGGG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("    GG            GG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("  GG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("GG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("GG          ")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("  GG             GG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("    GG           GG")
            SendKeys.SendWait("{enter}")
            SendKeys.SendWait("+{enter}")
            SendKeys.SendWait("      GGGGGGG")
            SendKeys.SendWait("{Enter}")
    Thanks guys sendwait worked.

    Now there are two more problem, one is that 90% of the time it treats
    Code:
    +{Enter}
    as
    Code:
    {Enter}
    +{Enter} is supposed to act like pressing shift enter, for those who play League of Legends that's sending a message to all chat. Instead my program usually ignores pressing shift and just send a single "enter" instead of a "shift AND enter"

    The second problem is that the formatting doesn't work in game. In notepad it makes a giant G made out of smaller G's, but in League of Legends all the spaces are shrunk to just one. Why?

    Thanks a ton for all the help so far guys
    Last edited by qwertySkill; 12-29-2012 at 02:00 PM.

  9. #6
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    1) i'm not sure about the syntax of 'holding one key' while 'pressing another' with sendkeys..google it something about alt keys..or pressing multiple keys at once, or even be specific and mention the shift key + SendKeys.

    2) the horizontal spaces? so "GG GG" becomes "GG GG" ?? LOL. mpgh does it too <--there are supposed to be like 7-8 spaces in the first quote. Let me try again.

    2)
    Code:
    instead of "GG        GG" it becomes "GG GG"    ??
    edit* I googled:
    https://msdn.microsof*****m/en-us/libr...ice.10%29.aspx should help.
    maybe something about "ENTER ~ (tilde)" -- try SendKeys.Send("+~") ???

    I just tested with SendKeys.Send("%f") to notepad and it opened up the File menu..so that worked, I can't think of an app to tes the Shift key on


    edit: maybe not good for your project, but look into keybd_event API, for simulating key-strokes. The HUGE down-side is that the app must be the active app (ie. u can never minimize the game and...browse the web, game must be forefront program)
    but it allows you to
    press a key down
    do something else
    release the key up

    so..
    Code:
    keybd_event(shift, key_down) ' start pressing the SHIFT key. Will continue to hold down until key_up called.
    threading.thread.sleep(200)
    keybd_event(enter,key_down) ' press enter key
    threading.thread.sleep(100)
    keybd_event(enter,key_up)     'release enter key
    threading.thread.sleep(100)
    keybd_event(shift, key_up)     'stop pressing the SHIFT key
    ^^ just a thought.

    -----------------------------
    there are only so many possible cases it could be..brute force it :P

    SendKeys.Send("+{enter}")
    SendKeys.Send("+{ENTER}")
    SendKeys.Send("{+enter}")
    SendKeys.Send("{+ENTER}")
    SendKeys.Send("+~")

    SendKeys.Send("{+}{enter}")
    SendKeys.Send("{+}{ENTER}")
    SendKeys.Send("{+}~")

    SendKeys.Send("{+}{~}")

    ^^surely, one of those works?
    Last edited by abuckau907; 12-29-2012 at 02:32 PM.

  10. The Following User Says Thank You to abuckau907 For This Useful Post:

    qwertySkill (12-29-2012)

  11. #7
    qwertySkill's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    My Mood
    Angelic
    I'll look into that. So I decided to ditch the "G space space space space G" thing entirely, I'm now doing G______G.
    I don't know what the problem is now. Before I used SendWait only one line would show up in game. Now that I'm using SendWait, it sends anywhere from 2-8 lines. I want it to consistently send all 8 lines.

  12. #8
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    do you have some kind of IM ? it's a little hard over forum. or be more specific what text? how are you storing it? string array() or StringBuilder or ? etc. Im ? I don't use...I used to use msn messenger, would have to re-download it really quick.

    ---------- Post added at 03:38 PM ---------- Previous post was at 03:37 PM ----------

    Maybe stop using sendWait and use Send() -- but really the problem is because you're trying to send too much text at once. Break it down into single lines. Or, if the game console lets you lets you insert newlines (usually shift+enter lol?) try Environment.newline instead of "/r" or "/n" or w/e

  13. The Following User Says Thank You to abuckau907 For This Useful Post:

    qwertySkill (12-29-2012)

  14. #9
    qwertySkill's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    My Mood
    Angelic
    I was thinking the same thing lol. Add my xfire : qwertyskill

  15. #10
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    done .

  16. The Following User Says Thank You to abuckau907 For This Useful Post:

    qwertySkill (12-29-2012)

  17. #11
    qwertySkill's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    My Mood
    Angelic
    The only problem I have now is that +{enter} with act like {enter}

  18. #12
    _VaXeL_'s Avatar
    Join Date
    Mar 2020
    Gender
    male
    Location
    South Africa
    Posts
    15
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    Extend the intervals between each click/action making it longer will fix it.

Similar Threads

  1. Problem cameraman for the game CrossFire
    By naif in forum Combat Arms Help
    Replies: 4
    Last Post: 03-03-2020, 06:49 PM
  2. Need Help How to Extract help would be nice for the game crossfire
    By chichichi999 in forum Homework & Learning Section
    Replies: 2
    Last Post: 06-29-2011, 11:13 PM
  3. Gift for The Game
    By Ryguy in forum Showroom
    Replies: 6
    Last Post: 04-20-2011, 08:12 PM
  4. Signature Request for The Game
    By The Game in forum Help & Requests
    Replies: 45
    Last Post: 07-05-2009, 11:28 AM
  5. Replies: 10
    Last Post: 11-15-2007, 03:19 PM