- This topic has 15 replies, 6 voices, and was last updated 11 years ago by ChiNa.
-
AuthorPosts
-
February 10, 2011 at 1:13 pm #190672pharaonMember
i made greeting app for paltalk 10 but i get little bug i were typing some thing in the room and the app is sending a greeting in the same time what I’m typing get erased …any way how to get over this?
i tried auto greeter here and it dosnt do the sameDecember 23, 2012 at 8:58 pm #190688ChiNaAdministratorI actually wanted to ask the same question.. Hopefully we could get an answer from our developers since I am very new myself c# and vbnet..
December 24, 2012 at 6:38 pm #190686ChikeMemberAnd I had another suggestion that does not use the clipbord.
December 24, 2012 at 9:08 pm #190685TWiZAMemberIn theory : before the line of code that sends the greet message, you’ll have to:
GETTEXTLENGTH
If > 0 then GETTEXT, store it in a variable
after the greet message is posted, SETTEXT ( your stored text) then send the key “END” to set the cursor at the end of your text.
I hope this pseudo-code is clear for you.December 24, 2012 at 9:18 pm #190684ChiNaAdministratorThank you so much guys.. Chike and Twiza…. I will give it a shot and get back at you guys asap…..
The reason why I wanted to know this was… I was planning to make a few widgets for IMFILES, and I wanted to to send a TEXT in room with different colors saying “Created by “DEVELOPER NAME”! As a Greeter!
But it should send it automatically when the program starts….I am stuck with the coloring and Auto send. How do I add colors to each “letter and words”?
EXAMPLE: Created by DEVELOPER NAME and make an auto sender when the program starts then it sends the exact word or words to the room… I tried a lot but failed….
Thank you very much in advance,, and Merry Christmas..
December 24, 2012 at 10:22 pm #190683StringMemberDecember 24, 2012 at 10:50 pm #190682ChiNaAdministratorEdited again few minutes later: I cant find the CoolText Source.. If you could help me get there String.. Thanks
Thanks String, I will def take a look now! Good too see you Mate…… And Thank you…
Below I have posted just a bit of the code I will be using ! Without the TIMER ofcourse, else I will be flooding the room.. 😀
Here is a little part of what I got:I REMOVED THE CODEAGAIN. It was actually an old Flooder i made long ago. Not good for posting the full code on here… But if I really go blank I will post a bit of it 😀
December 24, 2012 at 11:38 pm #190681autopilotMember@ChiNa-Man wrote:
I am stuck with the coloring and Auto send. How do I add colors to each “letter and words”?
Have a look over on im-integrations.com at DemoAdvancedReadSendPal10[VB2010].
December 25, 2012 at 4:35 pm #190680ChiNaAdministratorThank you Auto-Pilot.. I got that all the amazing links and downloads you posted on there! I am not trying to figure out how to send text auto into a room. Again Thanks to everyone helping in this case
December 25, 2012 at 5:59 pm #190679autopilotMember@ChiNa-Man wrote:
I am not trying to figure out how to send text auto into a room.
I know that you had seen that post on im-integrations before because you posted a reply to it, but you asked how to send formatted text to the pal room. The sample I sent you to shows just that, how to format the text (color fading if desired) and then sending it to the chat room.
When people respond, you should at least look at what they are giving you. The first line of the post i sent you to clearly states that it demos how to do the multi colored text post into a pal room.
@autopilot wrote:Here is an advanced demo project to show how to read text from Pal10 and send formatted (color fade) text to Pal10
December 26, 2012 at 9:34 am #190678TWiZAMemberI don’t know why this sudden generosity about sharing my code…
This the color fade function I use in TixT. I wrote it 4 years ago and it doesn’t look pretty 😆First of all, the function take a structure as parameter and return a string (rtf code).
so you will need this:
Public Structure TRTF Public Bold As Boolean Public Under As Boolean Public Italic As Boolean Public Size As Byte Public Color As Color Public Color2 As Color Public Text As String End Structure
If you are not familiar with RTF codes (Rich Text Format) and Colors RGB, I strongly suggest to google them up. If you just copy and past without understanding (or at least trying) you will never learn.
The messy part in the middle of the function that has no comment is pure math and logic. What I did is I take the positive difference between R G B values of the colors and divided by the length of my text ( Paltalk only allows 7 colors in one post, so 7 is the maximum I can divide by) that gives me the value by which I will increase from color1 to color2 to get the fade (Df variable in my code).
The loop builds my R G B arrays tha I will use to generate an RTF color table.
The rest of the code is just like generating html but it’s RTF codes: example bold, italic, etc…Public Shared Function sRTF_Fade(ByVal T As TRTF) As String Dim Rtf1 As String = "{rtf1ansiansicpg1252deff0deflang1036{fonttbl{f0fnilfcharset0 Tahoma;}}" '& vbCrLf Dim ColorTB As String = "{colortbl " Dim Color1(2) As Byte Dim Color2(2) As Byte With T Color1(0) = .Color.R 'breaking down the colors into Red Green Blue RGB Color1(1) = .Color.G Color1(2) = .Color.B Color2(0) = .Color2.R Color2(1) = .Color2.G Color2(2) = .Color2.G Dim NumberOfColors As Integer = .Text.Length ' length of the string Dim Df As Integer If NumberOfColors > 7 Then NumberOfColors = 7 'paltalk doesn't allow more than seven colors in one post Dim Tb(NumberOfColors - 1) As Byte 'the array to hold our color table of 7 colors or less Dim R(NumberOfColors - 1) As Byte, G(NumberOfColors - 1) As Byte, B(NumberOfColors - 1) As Byte For i As Byte = 0 To 2 Select Case Color1(i) Case Is > Color2(i) Df = (Color1(i) - Color2(i)) / (NumberOfColors + 1) Tb(0) = Color1(i) For j As Integer = 2 To NumberOfColors - 1 Tb(j - 1) = Color1(i) - (Df * (j - 1)) Next Tb(NumberOfColors - 1) = Color2(i) Case Is < Color2(i) Df = (Color2(i) - Color1(i)) / (NumberOfColors + 1) Tb(0) = Color1(i) For j As Integer = 2 To NumberOfColors - 1 Tb(j - 1) = Color1(i) + (Df * (j - 1)) Next Tb(NumberOfColors - 1) = Color2(i) Case Is = Color2(i) For j = 0 To NumberOfColors - 1 Tb(j) = Color1(i) Next End Select Select Case i Case 0 : Tb.CopyTo(R, 0) 'red Case 1 : Tb.CopyTo(G, 0) 'green Case 2 : Tb.CopyTo(B, 0) 'blue End Select Next Rtf1 &= "{colortbl " For i As Integer = 0 To NumberOfColors - 1 Rtf1 &= ";red" & R(i).ToString & "green" & G(i).ToString & "blue" & B(i).ToString Next Rtf1 &= ";}" '& vbCrLf Rtf1 &= "viewkind4uc1pard" & IIf(.Bold, "b", "") & IIf(.Italic, "i", "") & IIf(.Under, "ul", "") & "fs" & CStr(.Size * 2) Dim x As Integer = 0 If NumberOfColors < 7 Then For Each Ch As Char In .Text.ToCharArray x += 1 Rtf1 &= "cf" & x.ToString & " " & Ch Next Else Dim nw As Integer = .Text.Length / 8 For i As Integer = 0 To 8 Try Rtf1 &= "cf" & (i + 1).ToString & " " & .Text.Substring(i * nw, nw) Catch eX As Exception Debug.Print(eX.Message) Rtf1 &= "cf" & (i + 1).ToString & " " & .Text.Substring(CInt(IIf((i * nw) > .Text.Length, .Text.Length, (i * nw)))) 'Right(.Text, .Text.Length - (i * nw) + 2) End Try Next End If End With Rtf1 = Replace(Rtf1, vbCrLf, "par ") Return Rtf1 & "par }" End Function
The AlterColor function in TIXT is a joke once you understand this code. It’s only 5 or 6 lines of code. But You will have to DIY if you want it 😀
December 26, 2012 at 9:21 pm #190677ChiNaAdministratorI don’t know why this sudden generosity about sharing my code…
This the color fade function I use in TixT. I wrote it 4 years ago and it doesn’t look pretty 😆First of all, the function take a structure as parameter and return a string (rtf code).
Hi Twiza,,, I must take my hat of for that bro… Wow! Very clean explanation and very easy to understand,,
Thank you for sharing something private…. We never met befor, but I seen all your great work for so many years now! I am a big fan of all you guys have done here on Imfiles. I appreciate all the support and source you guys put out for people, and same thing goes for Im-Integrations….
________________I will now study what you posted here and I will def get back to you befor I can say more…..
Infact I did not know that Paltalk only allows 7 colors in one post… Awesome info..
Am trully thankfull for your time and contribution for making this Tutorial & Explanation,PS, I am a huge fan of your Tixt Products. 😳 Awesome job! and i know you have taking long time building it! As I know how long time it takes just to create the buttons….
Thank you very Much Bro Twiza, Regards ChiNa
December 26, 2012 at 10:20 pm #190676TWiZAMemberYou are very welcome. Enjoy your coding!
December 29, 2012 at 7:32 am #190675TWiZAMembera typo:
Color2(0) = .Color2.R
Color2(1) = .Color2.G
Color2(2) = .Color2.G <— should be Color2.BDecember 30, 2012 at 2:45 am #190674ChiNaAdministratorHi Twiza, Thanks a lot mate, I been looking all over your share durring the weekend! Kinda hard to set one and one together! Hopefully I will manage to understand all of the parts together..
Thanks a lot again
-
AuthorPosts
Related
- You must be logged in to reply to this topic.