[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.