What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Random numbers, prevent from being used more than once

Random numbers, prevent from being used more than once
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Random numbers, prevent from being used more than once
quote:
Originally posted by stu
lol, ok, so lets see if I get this right.. I should remove
code:
arrLyrics = GetAllLyrics();
from my personalMessage function, but add it in where the script is first initialized from..
yes

quote:
Originally posted by stu
So that should be put in OnEvent_Signin(Email), and OnEvent_Initialize(MessengerStart).

Edit: I think I would need to add it to the toggle function, that switches between on and off, as well *-)
Actually, you only need to add it once. Best to do this in the 'toggle' function.

The OnEvent_Signin() and OnEvent_Initialize() just need to point to the toggle function also. Because I suspect you currently have the same code in those functions also....

This is again optimizing code in a logic way, splitting things up, instead of putting many same code all over the place.

eg:
code:
function OnEvent_Initialize() {
        if (Messenger.MyStatus > 0) OnEvent_Signin();
}

function OnEvent_Signin() {
        GetUserSettings()
}

function OnEvent_SignOut() {
        SaveUserSettings();
        Toggle(false);
}

function GetUserSettings() {
        <read the user settings from the registry here, eg: should the stuff be enabled or not (= boolean value bEnabled below)>
        Toggle(bEnable);
}

function SaveUserSettings() {
        <write the user settings to the registry here>
}

function Toggle(bEnable) {
        if (bEnable) {
            arrLyrics = GetAllLyrics();
            <do some other stuff here, like starting timers or whatever>
        } else {
            <disable timers, etc>
        }
}

function personalMessage() {
        <...>
}
something like that...

In that way you only need to change stuff in one place.



quote:
Originally posted by stu
(Little bit off topic: I have copied most of this stuff from Toast Message, as it had a menu similiar to what I wanted, and then I tweaked it for myself. It has both of those functions doing the same thing, what exactly is the difference of them both, and do I really need both of them?)
You only need one of the two. The difference is only in what window it uses to get to the contactlist.

This post was edited on 07-05-2007 at 04:26 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-05-2007 04:23 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random numbers, prevent from being used more than once - by stu on 07-03-2007 at 10:14 PM
RE: Random numbers, prevent from being used more than once - by pollolibredegrasa on 07-03-2007 at 10:33 PM
RE: Random numbers, prevent from being used more than once - by foaly on 07-03-2007 at 10:34 PM
RE: Random numbers, prevent from being used more than once - by roflmao456 on 07-04-2007 at 03:15 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 06:01 AM
RE: Random numbers, prevent from being used more than once - by markee on 07-04-2007 at 02:17 PM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 02:31 PM
RE: Random numbers, prevent from being used more than once - by markee on 07-04-2007 at 02:35 PM
RE: Random numbers, prevent from being used more than once - by foaly on 07-04-2007 at 04:00 PM
RE: Random numbers, prevent from being used more than once - by stu on 07-04-2007 at 04:50 PM
RE: Random numbers, prevent from being used more than once - by roflmao456 on 07-04-2007 at 05:22 PM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 05:47 PM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 12:34 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 12:51 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 12:55 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 01:03 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 01:32 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 01:55 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 02:00 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 02:18 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 02:32 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-05-2007 at 02:45 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 02:51 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:07 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-05-2007 at 03:11 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:22 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:36 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:45 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:47 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:55 AM
RE: RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 04:23 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 04:30 AM
RE: Random numbers, prevent from being used more than once - by foaly on 07-05-2007 at 10:57 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 04:59 PM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 11:39 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