- This topic has 12 replies, 7 voices, and was last updated 17 years ago by Admin.
-
AuthorPosts
-
July 25, 2007 at 4:47 pm #187818DepartureMember
Okay people, This might get people interested again with programming apps for paltalk 😕
The following source codes is for:
1. Sending Text to paltalk
2. Getting Text from paltalk
3. Cleaning Text that has been retrived from paltalk
I code slighly diffrent from Admin and the other paltalk programmers here so it might be worth your while to take a look
//Enjoy, and I hope to see more pepole coding apps for paltalk.
July 26, 2007 at 1:28 pm #187830AdminAdministratorThanks man, I gonna see if I can use some of ya codes on getting the last line, tha shit is killing me lol
July 28, 2007 at 1:04 am #187829GoScripted-ComMembercool … I believed this can be recode so that it is comparable with 8.5, 9.0+, and 9.2
July 28, 2007 at 2:04 am #187828autopilotMember@GoScripted-Com wrote:
cool … I believed this can be recode so that it is comparable with 8.5, 9.0+, and 9.2
if you want a project that will send text to any version of pal8 or 9, you can use this
November 16, 2007 at 7:55 pm #187827intercepter_3MemberThe link doesnt work. Maybe after the latest renovations loco did killed the article.
November 16, 2007 at 8:43 pm #187826BattleStar-GalacticaMembera cow was killed
November 16, 2007 at 10:30 pm #187825ChikeMember@Admin wrote:
Thanks man, I gonna see if I can use some of ya codes on getting the last line, tha shit is killing me lol
The main problem is that line count changes when you resizing the room, and also text may be too fast. What I do is to save the last character in the text and see if there are any new.
In case there are more characters I run over all the lines that start after last known character to the current last character. That way I don’t miss any text.Haven’t looked at Departure’s code to see if that’s what he’s doing.
November 17, 2007 at 4:36 pm #187824AdminAdministratorDamn, and how would you do that 🙂 cause the code i am using suks or I dont really know, I mean I dont know if its the programs themselves that dont process the last line fast enough or the program actually dont take the last line allthe time 🙄
November 17, 2007 at 5:15 pm #187823ChikeMember@Admin wrote:
Damn, and how would you do that 🙂
For me it’s even not that critical because i do everything in pal process subclassing the text window 😉 by doing this I am sure the text window size can’t change.
At start i do
lines =SendMessage(rich20, EM_GETLINECOUNT, 0, 0);
last_index = SendMessage(rich20, EM_LINEINDEX, lines - 1, 0);
then each time i check
lines = SendMessage(rich20, EM_GETLINECOUNT, 0, 0);
index = SendMessage(rich20, EM_LINEINDEX, lines - 1, 0);
if (index <= last_index)
return;
last_line = 1 + SendMessage(rich20, EM_EXLINEFROMCHAR, 0, last_index);
And then go over the lines last_line to lines, as I am confident the lines are not going to change during this time.
For you it may be a bit more complicated. Maybe get the line by index and after you get the text make sure the line index didn’t change, and if it did do it over gain.November 19, 2007 at 12:39 am #187822AdminAdministratoraighty, the what i will try next thanks 🙂
November 25, 2007 at 9:04 am #187821ChikeMemberActually there’s a little bug in my code, since the room text is sometimes cleared.
The second part should be changed to update new text length:
lines = SendMessage(rich20, EM_GETLINECOUNT, 0, 0);
index = SendMessage(rich20, EM_LINEINDEX, lines - 1, 0);
if (index < last_index) {
last_index = index;
return;
}
if (index == last_index)
return;
last_line = 1 + SendMessage(rich20, EM_EXLINEFROMCHAR, 0, last_index);
In case you’re polling you may lose some text at this point, but i can’t see a way to avoid it.
Maybe check the last line anyway, as I am guessing the trigger for clearing the text is when a new text is inserted and the text exceededs certain length, or line count.November 25, 2007 at 2:41 pm #187820AdminAdministratorAh, now you lost me lol, but why would you loose some text, you mean is the line is too long?
November 25, 2007 at 8:51 pm #187819ChikeMemberIf you are polling, with a timer, and more than one line was added since last time you checked and then part of the text was cleared.
The text is now shorter, and the last_index must be aupdated to a new value that is less than it was before, so there is no way to tell what text is new and what you already checked.
But it is very rare that it happens, I wouldn’t worry about it at all. At most the bot will miss a command once a day.
I was just pointing the possibility it may happen LOL -
AuthorPosts
Related
- You must be logged in to reply to this topic.