- This topic has 2 replies, 2 voices, and was last updated 15 years ago by String.
-
AuthorPosts
-
February 18, 2009 at 6:54 am #190738intercepter_3Member
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 FunctionTo 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.
February 18, 2009 at 9:07 am #190740StringMemberShow 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?
May 12, 2009 at 5:19 pm #190739intercepter_3MemberYep I got it all workin with autopilots methods.
-
AuthorPosts
Related
- You must be logged in to reply to this topic.