What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Random Line Away messages

Random Line Away messages
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Random Line Away messages
quote:
Originally posted by SmokingCookie
Uhm.. Please let me think for another 10 seconds....

EDIT::

Change the last function to:
code:
var Index = new Array();

function RandomMessage() {
      Index[0] = Math.random().charAt(4); // could be any number between 2 and 18
      Index[1] = Math.random().charAt(7); //  // could be any number between 2 and 18
      Index[2] = Math.random().substr(Index[0],Index[1]); // Please note!! You need 99 messages, or the chat will send "undefined";
      return RandomMessages[Index[2]];
}



ermmm... that is the most "original" method I've seen to get a random number between x and y...

The proper way would be to multiply the random number (which is always a decimal number between 0 and 1) with a certain upper bound number to enlarge it, and maybe add another lower bound number to start the random number from...

Math.floor((upperbound - lowerbound + 1) * Math.random() + lowerbound);

see "CookieRevised's reply to [Request] Random Number Generator"...

And you might also check "CookieRevised's reply to Random numbers, prevent from being used more than once" for a snippet very related to this random message sending stuff...

Anyways, the script you've posted so far doesn't work at all like Aztek wanted.

Sorry to be so negative though... :(:$ But way cool that you at least tried to help.

Anyways, Aztek, did you already checked the official scripting Database? I wouldn't be surprised if the script you ask for already exists...

This post was edited on 06-29-2008 at 11:15 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-29-2008 11:12 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random Line Away messages - by Aztek on 06-29-2008 at 02:40 AM
RE: Random Line Away messages - by SmokingCookie on 06-29-2008 at 04:44 PM
RE: Random Line Away messages - by Aztek on 06-29-2008 at 05:12 PM
RE: Random Line Away messages - by SmokingCookie on 06-29-2008 at 05:29 PM
RE: Random Line Away messages - by Aztek on 06-29-2008 at 05:31 PM
RE: Random Line Away messages - by SmokingCookie on 06-29-2008 at 05:33 PM
RE: Random Line Away messages - by Aztek on 06-29-2008 at 05:42 PM
RE: Random Line Away messages - by SmokingCookie on 06-29-2008 at 06:03 PM
RE: Random Line Away messages - by CookieRevised on 06-29-2008 at 11:12 PM
RE: RE: Random Line Away messages - by SmokingCookie on 06-30-2008 at 07:29 AM
RE: Random Line Away messages - by Aztek on 06-29-2008 at 11:16 PM
RE: Random Line Away messages - by CookieRevised on 06-30-2008 at 01:35 AM
RE: Random Line Away messages - by CookieRevised on 06-30-2008 at 06:52 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On