My macro types to fast for the game to pick up

Posts 1–12 of 12 · Page 1 of 1
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
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
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
@riley Are you talking to me...? (Why quote me) edit* nvm- plz don't make post just to reply to me..

http://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?
@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
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:
http://msdn.microsoft.com/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?
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.
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
I was thinking the same thing lol. Add my xfire : qwertyskill
The only problem I have now is that +{enter} with act like {enter}
Extend the intervals between each click/action making it longer will fix it.
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us