Text posted not showing up in paltalk room

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

Text posted not showing up in paltalk room

Postby intercepter_3 » Mon Mar 05, 2007 9:21 pm


Ok Dudes,

I been lurking for a long time, and now I finally gotta ask you coding gurus for some help here. I have a bot I made for pal worked just fine on version 8. Except for my help menu. When a user in a palroom types $help my bot responds with a list of commands. But when I try to dress the list up with different colors, I get an error messages saying that there were non-printable charicters or message was too long. Now, from my research, its about 400 chars for a single message in PT. So I know that isnt the problem.

I am using the code for the greeter for PT 9 and everything still works great except this help menu. I like the codes I got here. Props to you who allowed it to be public. Works great!!!!!

I will post the problem code, and see if you can help me figure out why it keeps erroring out in the PT room. I will post one of the various ways I tried to do this and all error out.

Code: Select all
Private Sub HelpMe()
RTB5.Text = "..:;$kjv <Book> <Chapter>:<Verse>" & " $$ " & "$about" & " $$ " & "$help" & " $$ " & "$fav" & " $$ " & "$addfav" & " $$ " & "$delfav" & "::.."

RTB5.SelStart = InStr(RTB5.Text, "..:;") - 1
RTB5.SelLength = Len("..:;")
RTB5.SelColor = vbBlack
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$kjv <Book> <Chapter>:<Verse>") - 1
RTB5.SelLength = Len("$kjv <Book> <Chapter>:<Verse>")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, " $$ ") - 1
RTB5.SelLength = Len(" $$ ")
RTB5.SelColor = vbBlue
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$about") - 1
RTB5.SelLength = Len("$about")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, " $$ ") + 10
RTB5.SelLength = Len(" $$ ")
RTB5.SelColor = vbBlue
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$help") - 1
RTB5.SelLength = Len("$help")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, " $$ ") + 18
RTB5.SelLength = Len(" $$ ")
RTB5.SelColor = vbBlue
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$fav") - 1
RTB5.SelLength = Len("$fav")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, " $$ ") + 27
RTB5.SelLength = Len(" $$ ")
RTB5.SelColor = vbBlue
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$addfav") - 1
RTB5.SelLength = Len("$addfav")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, " $$ ") + 38
RTB5.SelLength = Len(" $$ ")
RTB5.SelColor = vbBlue
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "$delfav") - 1
RTB5.SelLength = Len("$delfav")
RTB5.SelColor = RGB(0, 90, 0)
RTB5.SelBold = True
RTB5.SelFontSize = 8
RTB5.SelStart = InStr(RTB5.Text, "::..") - 1
RTB5.SelLength = Len("::..")
RTB5.SelColor = vbBlack
RTB5.SelBold = True
RTB5.SelFontSize = 8

Call RoomSend(RTB5.TextRTF)

End Sub


The one thing that seemed tricky was the fact that I used double $$ between each command. I saw another bot pull this off once but I cant duplicate it. And the dude wont share the code. I tried several different combinations to this but this was the last attempt. I even tried having a with statement to select the whole line and make it bold and change fontsize to 8.

Any ideas or suggestions would be greatly appriciated.

intercepter_3
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Postby autopilot » Mon Mar 05, 2007 9:44 pm

your code looks like it should work (but i use vb 2005 and not vb6). I would add a richtextbox to the form and then set it = to RTB5 instead of the Call RoomSend(RTB5.TextRTF). This way you would be able to see if the RTB is being set correctly. If it is, then it would have to be the way you are sending it to the room.

autopilot
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby intercepter_3 » Mon Mar 05, 2007 10:04 pm

Paltalk: Message was not sent. The message was too long or contained non printable characters.


This is the error message I get. And I did put it in a richtextbox and it looked fine. I am using the same roomsend code that is in the PT9 greeter I found here.

If I change it to Call RoomSend(RTB5.Text) it sends the text but of course no bold or no coloring and is sent just fine.

Anyone got any suggestions?
Last edited by intercepter_3 on Mon Mar 05, 2007 10:11 pm, edited 1 time in total.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Postby intercepter_3 » Wed Mar 07, 2007 3:44 pm

Ok I figured I should just include the roomsend code I am using too.

Code: Select all
Sub RoomSend(Text As String)
Dim parent, child, alt, rich20 As Long
parent = FindWindow("DlgGroupChat Window Class", frmMain.Label1.Caption)
child = FindWindowEx(parent, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
alt = GetWindow(child, GW_Child)
alt = FindWindowEx(alt, 0, "AtlAxWin71", vbNullString)
alt = FindWindowEx(alt, 0, "#32770", vbNullString)
rich20 = FindWindowEx(alt, 0, "RichEdit20A", vbNullString)
rich20 = FindWindowEx(alt, rich20, "RichEdit20A", vbNullString)
Call SendMessageSTRING(rich20, WM_SETTEXT, 0&, Text$)
Call SendMessageLong(rich20, WM_KEYDOWN, 13, 0&)
End Sub


[/vb]
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Postby Departure » Wed Mar 07, 2007 4:33 pm

Code: Select all
Paltalk: Message was not sent. The message was too long or contained non printable characters.


That gives a pretty good hint....


I would just see what it looks like in the paltalk richeditbox before actually sending it to the room, you could do that by removing the keydown, that way you can get a view of it before its sent.... But judging by the paltalk error message its pretty much self explained why its not working.....
Last edited by Departure on Wed Mar 07, 2007 4:43 pm, edited 2 times in total.
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Postby intercepter_3 » Fri Mar 09, 2007 2:24 pm

Thanks for the reply. I did check this. I also checked it in a richtextbox on my form too. They look just fine. So, at this point I am stumped. So I figured I would do a debug.print and see if that might enlight either myself or anyone else.

My question is...is the roomsend sending all of the following?

[vb]{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
{\colortbl ;\red0\green0\blue0;\red0\green90\blue0;\red0\green0\blue255;}
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs16 ..:;\cf2 $kjv <Book> <Chapter>:<Verse>\cf3 $$ \cf2 $about\cf1 \cf3 $$ \cf2 $help\cf3 $$ \cf2 $fav\cf1 \cf3 $$ \cf2 $addfav\cf1 \cf3 $$ \cf2 $delfav\cf1 ::..
\par }[/vb]

The easiest way to fix this is just forget about all the coloring and just make it all one color. But, if possible I would like to make it a number of colors.

Any continued help is appricated.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Postby Ghost » Fri Mar 09, 2007 5:06 pm

Do what Dep said and remove or comment out the bit of code that sends the text to the room. Then, in the text box in the Paltalk room, you'll be able to see exactly what it sends.
Ghost
 

Postby autopilot » Fri Mar 09, 2007 7:11 pm

i dont know if this is your problem, but it cant hurt to try...
I believe paltalk is using Tahoma as it's font. Try changing your font from MS Sans Serif to Tahoma and see if you get any better results.

autopilot
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby intercepter_3 » Sat Mar 10, 2007 3:29 am

To Ghost:

Yes I had done this. I even took out all formatting to see how the message would print and it looks just fine. Not too long. I even put an extra Richtextbox on my form and it looks fine as well, and I even tried sending the test to the richtextbox and then using roomsend out of the 2nd richtextbox. They all result in the same error.

To Autopilot: Thanks for the suggestion. I tried to change the font name as well, still get the same error. I dont see any char problems in the test and I dont see anything else in the send box in the paltalk room window. Thats why I am totally stumped as to why this doesnt want to work.

The funny thing is, I have other code that sends out replys that are multicolored and they have no problems. Its just the repeating $$ I use as a seperator. I am going to try leaving these out and just leaving 2 spaces, lets see how this works.

More to follow
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Postby autopilot » Sat Mar 10, 2007 9:43 am

It works for me just fine (but i had to convert it for use in VB2005)

Code: Select all
Private Sub InitialSetRTB5()
        rtb5.Text = "..:;$kjv <Book> <Chapter>:<Verse> $$ $about $$ $help $$ $fav $$ $addfav $$ $delfav::.."
    End Sub

Code: Select all
Private Sub HelpMe()
        Dim MyStyle As FontStyle
        Dim MyFontSize, iColor As Integer
        rtb5.SelectionStart = InStr(rtb5.Text, "..:;") - 1
        rtb5.SelectionLength = Len("..:;")
        rtb5.SelectionColor = Color.Black
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$kjv <Book> <Chapter>:<Verse>") - 1
        rtb5.SelectionLength = Len("$kjv <Book> <Chapter>:<Verse>")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, " $$ ") - 1
        rtb5.SelectionLength = Len(" $$ ")
        rtb5.SelectionColor = Color.Blue
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$about") - 1
        rtb5.SelectionLength = Len("$about")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, " $$ ") + 10
        rtb5.SelectionLength = Len(" $$ ")
        rtb5.SelectionColor = Color.Blue
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$help") - 1
        rtb5.SelectionLength = Len("$help")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, " $$ ") + 18
        rtb5.SelectionLength = Len(" $$ ")
        rtb5.SelectionColor = Color.Blue
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$fav") - 1
        rtb5.SelectionLength = Len("$fav")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, " $$ ") + 27
        rtb5.SelectionLength = Len(" $$ ")
        rtb5.SelectionColor = Color.Blue
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$addfav") - 1
        rtb5.SelectionLength = Len("$addfav")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, " $$ ") + 38
        rtb5.SelectionLength = Len(" $$ ")
        rtb5.SelectionColor = Color.Blue
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "$delfav") - 1
        rtb5.SelectionLength = Len("$delfav")
        iColor = RGB(0, 90, 0)
        rtb5.SelectionColor = Color.FromArgb(iColor)
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
        rtb5.SelectionStart = InStr(rtb5.Text, "::..") - 1
        rtb5.SelectionLength = Len("::..")
        rtb5.SelectionColor = Color.Black
        MyStyle = FontStyle.Bold
        MyFontSize = 8
        rtb5.SelectionFont = New Font("Tahoma", MyFontSize, MyStyle)
    End Sub

Code: Select all
Private Sub SendRTB5()
        iHnd = FindPalSendTxtHnd()
        SendPalTxt(iHnd, rtb5)
        rtb5.Text = String.Empty
    End Sub

Code: Select all
Private Function FindPalSendTxtHnd() As Integer
        Dim parent, child, alt, rich20 As Integer
        parent = FindWindow("DlgGroupChat Window Class", me.Label1.text)
        child = FindWindowEx(parent, 0, "WTL_SplitterWindow", vbNullString)
        child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
        child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
        child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
        alt = GetWindow(child, GW_Child)
        alt = FindWindowEx(alt, 0, "AtlAxWin71", vbNullString)
        alt = FindWindowEx(alt, 0, "#32770", vbNullString)
        rich20 = FindWindowEx(alt, 0, "RichEdit20A", vbNullString)
        FindPalSendTxtHnd = FindWindowEx(alt, rich20, "RichEdit20A", vbNullString)
    End Function
Last edited by autopilot on Sat Mar 10, 2007 9:58 am, edited 1 time in total.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby intercepter_3 » Sun Mar 11, 2007 5:12 pm

And thats the odd thing, it works but it doesnt work. And I cant figure out why.
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