Skip to content
Buzzen Chat Network

Sending A Linefeed

A TG007 community discussion started by Psych.

Discussion 28 posts
Page 1 of 2
Open
Topic #8646 · 28 published posts · 6,982 views

Hi, I've been writing a bot myself using vbexpess, now I want a game add-in, but I cant send a linefeed in the PRIVMSG. Si I can list Halls Of Fame, etc.

 

Does anyone know the raw chars I have to send to get a linefeed to the channel?

 

Thanks in advance.

Chr(10)

Chr(10)

 

I tried that, lol, it doesnt work. I've even tried using a PRIVMSG with no formatting.

 

Strange thing is, I've looked at other scripts, and they do use the chr(10) character, but when I send it, it doesn't give me a linefeed.

Hi, I've been writing a bot myself using vbexpess, now I want a game add-in, but I cant send a linefeed in the PRIVMSG. Si I can list Halls Of Fame, etc.

 

Does anyone know the raw chars I have to send to get a linefeed to the channel?

 

Thanks in advance.

 

You are putting trivia in your room Psy?

Ειναι πολλα τα λεφτα Αρη.

 

 

 

You are putting trivia in your room Psy?

 

I am thinking of having various game add ins for the bot, not necessarily the room, however the room will a testing ground for anything I publish, lol.

 

Back to the linefeed thing, would my encoding the linefeed into UTF8 make any difference?

I am thinking of having various game add ins for the bot, not necessarily the room, however the room will a testing ground for anything I publish, lol.

 

 

 

Oh I know what you mean now.Thanks.

 

Ειναι πολλα τα λεφτα Αρη.

 

 

 

dim EndOfLine as string

 

EndOfLine = chr(13) & chr(10) ' = \n

 

'if you want to print something like

'Hello\nWorld

 

debug.print "Hello" & EndOfLine & "World"

 

have you tried that?

Hi webby, I already have a linefeed variable as i need it to delimit the server text back and forth Chr(10) and Chr(13) or just VbCrLf.

 

The more I think about it the more I am convinced it must have something to do encoding, as I encode and decode server traffic using the UTF8 standard. I am going to investigate this first. It does have me at a loss I must say.

Okay, it doesnt seem to have anything to do with encoding.

 

This is the string I am sending....

 

"PRIVMSG %#TESTROOM :S Tahoma;0 First Line" & Chr(10) & "Second Line"

 

Are we assuming this should work?

 

What I get on the screen is this...

 

BotNick : S Tahoma;0 First Line

 

Nothing else.

<-- is that chr(1) ?

Edited Jun 30, 2007 12:21 AM by Pyscho

Did you get that string out of the console window? Try to use debug.print and you can see in your console window when debugging (put a line breakpoint in front of your code for example) if it shows a linefeed before the data is going to the encode/decode parsing.

Did you get that string out of the console window? Try to use debug.print and you can see in your console window when debugging (put a line breakpoint in front of your code for example) if it shows a linefeed before the data is going to the encode/decode parsing.

 

I've a few methods of seeing what I send, firstly I have a trace window under my 'screen' that I use to chat. The socket class I wrote has a datasent event that tells me what raw characters I sent to the server, I also wrote a simple program yesterday that gives me the character codes of any text in a textbox. Its a bit baffling.

 

In my trace window, the text I send has a linefeed, as it should, and it outputs on a new line, but for some reason the server doesn't relay this back to the room.

 

I am sending the 10 character.

 

And yes, the first and last little boxes you saw would be chr(1).

i know that in MSN chat, you had to use one of the following characters as line feeds (as it played with UTF-8 encoding, like you suggested above). Remember, these are already in the raw formats, so you shouldn't need to convert them (or you SHOULD NOT convert them).



ï€


 

You only need 1 of these 3, so try them and see what you get.

 

 

And make sure the persons whispers are on lol.

Okay, it doesnt seem to have anything to do with encoding.

 

This is the string I am sending....

 

"PRIVMSG %#TESTROOM :S Tahoma;0 First Line" & Chr(10) & "Second Line"

 

Are we assuming this should work?

 

What I get on the screen is this...

 

BotNick : S Tahoma;0 First Line

 

Nothing else.

 

That will not work because CRLFs are used to delimit commands in the IRC protocol, like most others. This means that to send multiple lines to a channel you will have to issue multiple PRIVMSG commands, like so:

 

"PRIVMSG #channel :Line one" & Chr(13) & Chr(10) & "PRIVMSG #channel :Line two" & Chr(13) & Chr(10)

 

Chr(10) by itself is just a line feed. You must also use a carriage return - Chr(13)

Wrong.

 

What you need to do is this:

 

"PRIVMSG %#TESTROOM :S Tahoma;0 First Line" & Chr(239) & "Second Line"

 

He is not wanting to send a crlf, but rather to make the next line appear on a new line in an msn web chatroom.

Edited Jun 30, 2007 11:28 PM by Pyscho

hello...? have you even tried my suggestion?

 

The problem with using line feed is that the server is expecting a new command. When you do line feed, it expects that you are doing a new command straight after. I'm reasonably sure this is why it's not working.

Hi again,

 

I've tried the 239 thing, trouble is it encodes as a character and doesn't give a linefeed.

 

BotNic : First Line ïSecond Line

 

What gets me about all this is that I've seen chr(10) sent from another script, yet when I try it doesn't get through.

 

I tried the groups of 3 characters too, no success.

 

Maybe if I turn the encoding off it may work, I'll try that next.

like i said, the characters i gave you should not be encoded, otherwise it will send the wrong thing.

 

I am not too sure if your encoder compensates for line feeds and that. I know that when i was doing vb.net (as in mucking around with it) and even with mIRC and chat servers, line feeds would always imply a new. Regardless of if the previous statement is complete or not. Do you have a debug window? It should normally say something like <second line> unknown command or something.

like i said, the characters i gave you should not be encoded, otherwise it will send the wrong thing.

 

I am not too sure if your encoder compensates for line feeds and that. I know that when i was doing vb.net (as in mucking around with it) and even with mIRC and chat servers, line feeds would always imply a new. Regardless of if the previous statement is complete or not. Do you have a debug window? It should normally say something like <second line> unknown command or something.

 

 

Okay, I kinda get what yur saying, I only use the UTF8 encoding to get correct names in the chatters list anyway, I'll simply have to write another method in the socket send routine to send all the characters unformatted, and since the roomnames contain no special characters, I should be able to send the whole privmsg in ACSII (I think).

 

Now, this does cause a problem, I originally wanted this for a Hall Of Fame, that being the case all names using special characters wont output correctly (I had this problem with VB6, I couldnt get names to display correctly, they were either displayed as boxes or as ? marks) and that would kinda defeat the object.

 

I will try though, I'm curious to know what's causing it not to function as it should. If I find out why, I'll post the solution.