Get Text and Autopilots methods

In this forums, you can get help for any programming language.

Get Text and Autopilots methods

Postby intercepter_3 » Wed Feb 18, 2009 1:54 am


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.

Code: Select all
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.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Re: Get Text and Autopilots methods

Postby String » Wed Feb 18, 2009 4:07 am

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
Code: Select all
'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?
-= Please ask your questions in the forum, not in pm.
String
imFiles Senior
imFiles Senior
 
Posts: 313
Joined: Mon Mar 10, 2008 7:06 am
Location: IDE

Re: Get Text and Autopilots methods

Postby intercepter_3 » Tue May 12, 2009 12:19 pm

Yep I got it all workin with autopilots methods.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am


Return to Programming Help

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

cron