How to begin a new line in a bot-PM from *.txt-file

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

GraviT
Posts: 1
Joined: 2003-08-11 10:04
Location: GraviT.No-IP.info

How to begin a new line in a bot-PM from *.txt-file

Post by GraviT » 2003-08-11 10:20

:?: I have a script that makes my bot send a PM to persons issuing certain commands... (fx. !rules) But for some reason does the script/PM not use the format from the *.txt-file (There doesn't appear any new lines in the PM), I'm pretty much at n00b at scripting but i hoped that someone out there could help me out... PLEASE :o

-Sorry my bad english-

MangaDav
Posts: 9
Joined: 2003-04-09 10:05
Location: Bruxelles

Post by MangaDav » 2003-08-11 17:45

There are two possibilities...
The first is : Make the new lines yourself... The code for a new line is vbcrlf (for Visual Basic Carriage Return Line Feed) so this code works :


Line1 = ...
Line2 = ...
curUser.PrivateMessage sBotName, Line1 & vbcrlf & line2


The second possibility is to read the whole text-file and send the whole file at a time :

Set oFs = CreateObject("Scripting.FileSystemObject")
Set oF = oFs.OpenTextFile("C:\MyFile.txt", 1, false)
sMsg = oF.ReadAll
curUser.PrivateMessage sBotName, sMsg
oF.close

Personnaly, I prefer the second code 'cause it's surely mre optimized to read a whole file...


I hope I'll have helped you ;)

Who is online

Users browsing this forum: Google [Bot] and 0 guests