Messenger Plus! Random Text Script
June 25th, 2006
Further to my earlier post about Messenger Plus! Live, I decided to flex my Javascript skills so I attempted to write a script for Messenger Plus! Live. It was dead easy to write a script; even easier than writing a Firefox extension. I suppose my script is fairly basic as it doesn’t require any new UI or i18n or anything but I’m still quite impressed how easy Patchou made it to write a script.
This is a dead simple script. All it does is it reads a text file every 10 minutes, picks out a random non-blank line from that file and then sets that as your Personal Message on Messenger. You could use this script with IRC logs, a list of quotes, etc.
Source Code
function updateMessage() { FileSystem = new ActiveXObject("Scripting.FileSystemObject"); file = FileSystem.OpenTextFile("E:/Documents/testfile.txt", 1); i = 0; lines = new Array();
while(!file.AtEndOfStream) { line = file.ReadLine(); if (line != '') { lines[i] = line; } i++; }
file.Close(); linenum = Math.floor(Math.random()*lines.length)-1; Messenger.MyPersonalMessage = lines[linenum];}
function OnEvent_Initialize(MessengerExit) { }function OnEvent_Uninitialize(MessengerExit) { }
function OnEvent_Signin(email) { if (email == Messenger.MyEmail) { updateMessage(); MsgPlus.AddTimer('randomtext', 600000); }}
function OnEvent_Timer(timerId) { if (timerId == 'randomtext') { updateMessage(); MsgPlus.AddTimer('randomtext', 600000); }}
Hopefully most of this script should be fairly self-explanatory. OnEvent_Signin is called when a user signs in. This function checks that it is the current user who has just signed in, and if so calls updateMessage() and schedules the next call for in 10 minutes time.
OnEvent_Timer gets called when a timer is triggered - in this case it’ll get called after 10 minutes. The function calls updateMessage() and schedules the next call for in another 10 minutes time. updateMessage() opens a text file, reads the whole file putting it into an array and then selects a random line and sets it as the personal message.
Usage
To use it, go to Plus > Scripts and select "Create New". Enter a name for the script and paste the contents of the script above into it and save it. You’ll have to sign out/sign in or restart Messenger to make it work. Make sure you’ve also changed the path to the text file which is E:/Documents/testfile.txt by default.
It’ll overwrite your whole personal message. If you want it to appear as part of your personal message, concatenate the random line with something else. For example, you could change:
Messenger.MyPersonalMessage = lines[linenum];
To:
Messenger.MyPersonalMessage = 'My Personal Message | '+lines[linenum];
If you want to change the update interval, change the value of 600000 (600000ms is 10 minutes).
- Cool Stuff , IM , Microsoft
- Comments(16)

Digg
StumbleUpon
hi i want to download MSN MESSENGER PLUS WITHOUT LIVE! but it just won’t let me!
…I have tried downloading loadsa different msn to get it but still can’t! Please email me i won’t remember this website! shopaholic165342@aol.com Thank you for your time! Mrs.Flitstik

niceeeeeeeeee
thnxxxxxxx
Hi.
For some reason this didn’t work for me, so I changed it a little bit (I got errors in the OnEvent_Signin() function, something about line 3 that ” isn’t a valid name).
I put:
updateMessage();
MsgPlus.AddTimer(’randomtext’, 600000);
in the OnEvent_Initialize() function and deleted the OnEvent_Signin() function. Now it works.
Also, remember that when you specify the filename of the PM file and you’re using a backslash, make sure to use 2 backslashes (\\) instead of 1. If you don’t you’ll get a "File not found" error.
Thanks anyway!
i cant download msn plus without having to download live messenger which i don’t want. how can i download msn plus without having 2 do this?
Heloo im in skwll Lol it borin im tryin 2 find msn 2 chat 2 all my friends it get on my nevers
im sooo in Love with this boyy 
im soo bored
and tried
Pleaseee Help Me !!
xx Thanks xx .. FromEllieBolingbroke !! REPLY PLEASE !!
hi,
if i want to change this script that not work for random. what must i do?
can u help me to fing out the activation code for msn plus it is doin my head in plzzzz can anyone help me and add me if u no it thanks a lot david http://cow.neondragon.net/ui/emoticons/ninja.png
(dhliptrot@hotmail.com)
http://cow.neondragon.net/ui/emoticons/ninja.png
(davidliptrot@hotmail.co.uk)
http://cow.neondragon.net/ui/emoticons/ninja.png
hey if you ac msn pluc try *oxfam nd see 4 yourself
Msn Live Is Really Bad!.. Can You Help Me Get The Normal Just Msn Plus Back Not Msn Plus! Live .. it not let me download it !! ARRRHH
OK my frind has downloaded this file that happened to be a shitty scrip thats now obducted her msn and her desktop so she has messages getin sent to al her contacts wen they chat 2 her and its sayin is this a photo of you and gives a link 2 this php site bolox so any1 clever enuf to work out how 2 successfully remove this as its not detected as a trojan or a virus cus as evry 1 with half a brian knows this isnt a virus or trojan but a scrip which is just as clever as a virus an trojan put 2gether so nay ideas where this crap goes to on msn and how 2 remove it plz add my email and let me know an no i dont check this site often and yer this me 1st tym so probly be me last especially if i dont get a reply which i aint as yet so any ideas email me i have loads of stuff 2 offer if you can help and she a really sweet gurl im tryin 2 help so plz be quick with ya respons ya know gurls dont like w8in lmfao
seriously if ya know tell me asap thanks 
ryt does any1 kno har til get MSN weird maker writng as yer normal msn writn ??
HELP ME IAM DAMLODING MSN AND IT SAY I NEED TO BUT ,
IN THIS CODE,
WHAT IS THE CODE,
PLZ HELP ME!
FROM EMMA !
This is not the Messenger Plus support forum. Please use the forums at http://www.msghelp.net/ for support with Messenger Plus.