PaltalkScene 9.2 Source codes

You can talk about VB programming here

PaltalkScene 9.2 Source codes

Postby Departure » Wed Jul 25, 2007 11:47 am


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 Locohacker 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.
Attachments
Paltalk Code Examples.rar
Simple Paltalk Code Examples
(2.62 KiB) Downloaded 274 times
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Postby locohacker » Thu Jul 26, 2007 8:28 am

Thanks man, I gonna see if I can use some of ya codes on getting the last line, tha shit is killing me lol
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Postby GoScripted-Com » Fri Jul 27, 2007 8:04 pm

cool ... I believed this can be recode so that it is comparable with 8.5, 9.0+, and 9.2
GoScripted-Com
 
Posts: 1
Joined: Mon Apr 09, 2007 1:11 pm

Postby autopilot » Fri Jul 27, 2007 9:04 pm

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
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Re: PaltalkScene 9.2 Source codes

Postby intercepter_3 » Fri Nov 16, 2007 2:55 pm

The link doesnt work. Maybe after the latest renovations loco did killed the article.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Re: PaltalkScene 9.2 Source codes

Postby BattleStar-Galactica » Fri Nov 16, 2007 3:43 pm

a cow was killed
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Re: PaltalkScene 9.2 Source codes

Postby Chike » Fri Nov 16, 2007 5:30 pm

locohacker 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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: PaltalkScene 9.2 Source codes

Postby locohacker » Sat Nov 17, 2007 11:36 am

Damn, 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 :roll:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: PaltalkScene 9.2 Source codes

Postby Chike » Sat Nov 17, 2007 12:15 pm

locohacker 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 :wink: by doing this I am sure the text window size can't change.
At start i do
Code: Select all
lines =SendMessage(rich20, EM_GETLINECOUNT, 0, 0);
last_index = SendMessage(rich20, EM_LINEINDEX, lines - 1, 0);

then each time i check
Code: Select all
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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: PaltalkScene 9.2 Source codes

Postby locohacker » Sun Nov 18, 2007 7:39 pm

aighty, the what i will try next thanks :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: PaltalkScene 9.2 Source codes

Postby Chike » Sun Nov 25, 2007 4:04 am

Actually 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:
Code: Select all
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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: PaltalkScene 9.2 Source codes

Postby locohacker » Sun Nov 25, 2007 9:41 am

Ah, now you lost me lol, but why would you loose some text, you mean is the line is too long?
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: PaltalkScene 9.2 Source codes

Postby Chike » Sun Nov 25, 2007 3:51 pm

If 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
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests