hi
the problem in getlastline code
If the sent text is so long that it takes 2 or 3 lines, then only the last line will be returned.
this affect the auto answer(responder) and swearBot
Ex:
paluser11:hi what’s your problem ?
PalUser22:the problem in getlastline code
Gets the last line ,,,,doesn’t get the full comment
If the sent text is so long that it takes 2 or 3 lines, then only the last line will be returned
I want to get the last comment
PalUser22:the problem in getlastline code
Gets the last line ,,,,doesn’t get the full comment
If the sent text is so long that it takes 2 or 3 lines, then only the last line will be returned
not last line
this solution by String:
You can get around some of this by stretching the chat room window to its maximum width. Also, removing the text formatting for incoming text also will help.
.
but this solution doesn’t work always
How to get a full comment by code
I saw this in some programs
basically what the others said, find the text character “:” and #13#10 which is a tab + return carriage which normally indicates a new line, so find this new line before the return carriage and get the position of text from there, this will be your last line, exception possibly could be if someone used the char “:” in there text and also had a return carriage just before it.
to be honest this is the easiest way but not the best way as you are filling your buffer with all the text from the room and then parsing it. not to mention all this is done on timer, plus the fact you need to compare if you have received that last line or not in your parsing function, this method is very resource hungry.. get paltalk to do the “dirty” work for you as use hooks
I have one proposed a way to get ALL lines that have not been read before, as much it is possible as paltalk start cutting the lines from top when the room test reach a certaim size.
I have already proposed a solution for that.
Too lazy to search it, you do it 😛
I believe this is the post Chike mentioned above. I’d forgotten about it, and I’ve even posted in it haha.
Actually there is no need to delete all room text.
It is possible to delete from the top like paltalk does, and keep track of line count so nothing is ever missed.
I probably was lazy that time.
Don’t you say here winsock hooks don’t work anymore?
http://www.cheesydoodle.com/?p=73
🙂 Thank you String
as chike said…. I was reffering to API hooking or code hook, BUT you can still hook winsock and capture the packets and parse them out for room/pm text, Only problem with using winsock hook for room text is you still need to parse, admittedly not as much parsing as you need for “lastLine” method but winsock hooking also brings a large detection rate from AV’s which would not make much sense for public applications, the last thing you want is users coming back accusing you of planting virus/trojan in your releases. I will be releasing some sources and tutorials about “hooking” and i am sure chike, string, loco and the other vb coders will convert and improve the code if they think it suits there needs..
@usenet7 wrote:
Where did you see “winsock” in his post?
Thank you String , I will try
@light 2012 wrote:
How can it be first only?
When last comment consisting of two lines
If I used TextBox to display the last comment appear only the first line of the comment
@light 2012 wrote:
Is your textbox set to Multiline?
YES STRING
Where is wrong? Does this happen with you?
The only other thing I can think of, is this… but I really don’t think its a good solution for this problem.
In your GetLastLine function ( or whatever you call your function to get the last line) you’ll notice a line of code that looks something like this:
Notice the -2
This code is saying to retrieve the next to last line from the text, as the last line is always empty.
So, you could test each string that you receive from your GetLastLine function to see if it contains the character “:”. The existence of a “:” would tell you that the last line received contained a username ( username : Hello world) and so, is probably the full line of text. If the last line received did NOT contain a “:”, you could assume that you are only receiving the wrapped portion of the string. You could then write some code to get the text from one more line above ( -3). That would give you the text from the line above the previous line you received. Confused? I am……
But, doing it this way would assume that the text has only wrapped once, and that the wrapped text doesn’t contain a “:”.
That’s really all I can come up with. This topic has been discussed quite a bit here on the forum and no really fool proof way of doing it has been provided. Perhaps the methods mentioned by Departure in your other thread will yield a better way to do this.
I wont be at my normal machine till after the weekend, so I’m unable to test any code. But, if i understand exactly what your trying to do, your going about it the long way. I’m assuming all the code in red is code that isn’t working? In the future, enclose your code within the [*code] tags provided. Its so much easier to read.
In your GetLastLineTextChat function, You code looks like:
I wouldn’t bother getting the line above ( -3) unless I needed to. Find out if your last line string contains a “:” or not, then, if it doesn’t, get the line above. Like:
I don’t think you need all the code in red at the bottom.
when i used this code
Why text1=first line not first and second line in last comment?
Not finished yet I need your help and your experience
I got the last line and line before the last and worked compared
code: