Results 1 to 4 of 4

Thread: [RESOLVED] [HELP] Detect String

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Location
    St. Louis
    Posts
    14

    Resolved [RESOLVED] [HELP] Detect String

    EDIT: Thanks to LaVolpe and jpbro, the code is:
    Code:
    Dim iPos As Integer
    iPos = InStr(1, LogText, "!ban", vbTextCompare)
    If iPos Then 
          banTxt = Mid$(LogText, iPos + 4) ' +4 is length of !ban
          'Command
    Else
    End If

    Hey Guys!
    I had a thread in MSDN Help Center, and they redirected me to this forum as I have VB6. I have the Enterprise version (legal of course), and I need help.

    Code:
    If (InStr(1, LogText, "!ban ", vbTextCompare) > 0) Then
    Call SendMessage(hWndTextbox, WM_SETTEXT, 0, "/ban ")
    Call PostMessage(hWndTextbox, WM_KEYDOWN, VK_RETURN, 0)
    Sleep (75)
    End If
    This is what I am trying to do^. I want to detect text from my chat box in my game. If it detects "!ban XXXXXX" from a user, I want to send a "/ban XXXXXX" from a server hoster (me). How do I detect the input after "!ban "?

    Call SendMessage(hWndTextbox, WM_SETTEXT, 0, "/ban " & "//HERE\\")

    ^


    Thanks In Advanced.
    Last edited by Vlad1k; Feb 9th, 2012 at 03:06 PM. Reason: [RESOLVED]

Posting Permissions

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



Click Here to Expand Forum to Full Width