Joined: 29 Dec 2004 Posts: 367 Location: Australia
Posted: Sun Apr 24, 2005 8:41 am Post subject:
in many of my commands i have things like this:
Code:
my $websmenu = <br />" Google query here - Search google.<br /> spellcheck word - Check a words spelling<br /> translate text*fromlanguage*tolanguage - Translator<br /> dict word - Dictionary<br /> hsec - Get The US Homeland security level.<br /> acro acronym - Gets the meaning of an acronym<br /> speech - Text to speech with many voices!<br /> horoscope sign - Get you daily horoscope!<br /> whatpulse user - Get a what pulse profile";<br /><br />&send($self, $websmenu,$username, Color => "005500");<br />
When it is printed in the console it appears correctly, but when it is received over MSN, extra line breaks are inserted, ie.
Quote:
hsec - Get The US Homeland security level. acro acronym - Gets the meaning of an acronym speech - Text to speech with many voices!
Joined: 27 Jan 2005 Posts: 109 Location: Lewiston, ME
Posted: Sun Apr 24, 2005 11:01 am Post subject:
take out the hard line breakes and use \n
Code:
my $websmenu =<br />" Google query here - Search google.\nspellcheck word - Check a words spelling";<br /><br />or<br /><br />my $websmenu =" Google query here - Search google.";<br />my $websmenu .="\nspellcheck word - Check a words spelling";<br />
AOL does the same thing to trillian users when I load data from a file and dump it directly in a message without chomping and using \n.
chomped it is the same, i dont remember having this issue when my bot was on windows, only now its on linux does it seem to have occured. [right][snapback]48003[/snapback][/right]
Yeah, I wrote a chat script using a Windows server and in Linux it had that line break problem. I had to go in and do more with the stuff manually.....
But my problem was in opening files with multiple lines, and I fixed it by just turning \r\n\r\n into \n or something like that. I don't think that helps you much though since you're not using arrays and foreach loops. _________________ Current Site (2008) http://www.cuvou.com/
ah, that may be the link with what cer said, if you used the files on linux then its formatted with \n\r or something i think but \n for windows, somethink like that anyway,
\n works fine on Linux. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
I don't know how well it will work for your case though, since Perl codes usually need more than one line. Of course you could go on a foreach through the @filedata array and push each line onto an @newarray or something when you're done with it. _________________ Current Site (2008) http://www.cuvou.com/