Skip to content

Get Text and Autopilots methods

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #190738

    Hey all,

    I must be missing something really obvious here. I need to get a function to get the text from a pal room and I cant seem to get this code going. Let me post what I have and if someone could get me started in the right direction, that would be awesome.

    Function lastline()
    Dim iHnd As Long
    On Error Resume Next
    iHnd = ReadTextHnd
    Dim X As Long
    Dim xx As Long
    Dim xxx As String
    Dim xxxx As String
    Dim xxxxx As String
    Dim xxxxxx As String
    Dim xxxxxxx As String
    Call GetWindowText(iHnd, WM_GETTEXT, 4)
    'X = GetTextPal
    'X = GetWindowText
    For xx = 1 To Len(X)
    xxx = Mid(X, xx, 1)
    xxxx = xxxx & xxx
    If xxx = Chr(13) Then
    xxxxx = Mid(xxxx, 2, Len(xxxx) - 1)
    frmMain.RichTextBox2.Text = xxxxx
    xxxx = ""
    End If
    Next xx
    xxxxxx = Val(xx) - Len(xxxx)
    xxxxxxx = Mid(X, xxxxxx, Len(xxxx))
    lastline = xxxxxxx
    End Function

    To be honest, I dont know what the cch variable is. And this code returns 0 for iHnd.

    I know some of this is an old method, but it didnt hurt anything to leave stuff there till I figured out what I was doing wrong.

    #190740
    String
    Member

    Show how you are using your lastline function.
    If you have added this to autopilots example, as described in your other post, get the room handle info first then call your last line function.

    In the code you posted, you have

    'X = GetTextPal
    'X = GetWindowText
    For xx = 1 To Len(X)
    xxx = Mid(X, xx, 1)

    According to that code, the length of X will always be 0.

    Did you look how it was done in loco’s AdminBot source as mentioned in your other post?

    #190739

    Yep I got it all workin with autopilots methods.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.