What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Question about "MyStatus"

Question about "MyStatus"
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Question about "MyStatus"
Because it does not use a very slow, and completely unneeded, loop. Nor does it need two arrays being stored in memory.

Image what would happen if there are 10000 elements you need to index. Your script would run so slow you would think it has been froozen/crashed.

stoshrocket's script did this:
code:
1) Make a list of names:
    number 1 is BlahBlah
    number 2 is BooBoo
    number 3 is HeyHey

2) Make a list of numbers/indexes
    number 1 is 1
    number 2 is 2
    number 3 is 3

3) Change the list of numbers into a list of names
    Check if the index is still within the bounds of the number list
    if so, lookup name 1 and store it in memory
    Replace index 1 with the value stored in memory
    increase the index by one
    Check if the index is still within the bounds of the number list
    if so, lookup name 2 and store it in memory
    Replace index 2 with the value stored in memory
    increase the index by one
    Check if the index is still within the bounds of the number list
    if so, lookup name 3 and store it in memory
    Replace index 3 with the value stored in memory
    increase the index by one
    Check if the index is still within the bounds of the number list
    if so, ...., if not end the loop

4) Look up the current status

5) Get the correct name in the list of numbers.
So, even if you used an array, you can see that there is really no need for two arrays. The array in step 2 is completely useless because you already have all the names in order in the first array. Making the loop also useless. The second array is simply a list of its own indexes (an index is the number which defines an element of the array).

Matti's script does this:
code:
1) Make a list of status names, indexed and sorted by their literal numeric value: blahblah, BooBoo, HeyHey
2) Look up the current status
3) Get the correct status name in the list of statusses
Matti simply uses Messenger.MyStatus to get the proper element directly from the list.

This is possible since the numeric values of Messenger.MyStatus are known and always the same.

eg: Messenger.MyStatus will always return the number 2 when you are appearing offline. So simply grab the third (counting starts at 0) element out of the predefined string list.



It's like:

You have a piece of paper showing a number  (= Messenger.MyStatus) which tells you behind what curtain your prize (= your status strings like "offline", "online", etc) is.

stoshrocket's method:

First, construct a bunch of curtains and put some prizes behind it.

Second, construct a bunch of new doors and put a new piece of paper behind it like so:
Door 1, instructon on the new piece of paper: open curtain 1
Door 2, instructon on the new piece of paper: open curtain 2
Door 3, instructon on the new piece of paper: open curtain 3
etc..
this is the loop

Next, open the door with the number listed on your original piece of paper.
Then, open the curtain instructed on that new piece of paper you've found behind the door you've opened....

But did you notice how all those doors have the exact same number as the number in the instructions of those new pieces of paper behind each door?

Thus Matti's method:

First, construct a bunch of curtains and put some prizes behind it.
Second, directly open the curtain with the number that is on your original piece of paper....


^^ sorry for the long post, I was bored
:p

This post was edited on 01-17-2010 at 11:00 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-17-2010 10:26 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 06:01 PM
RE: Question about "MyStatus" - by stoshrocket on 01-17-2010 at 06:29 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 07:24 PM
RE: Question about "MyStatus" - by Matti on 01-17-2010 at 07:56 PM
RE: Question about "MyStatus" - by stoshrocket on 01-17-2010 at 08:10 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 08:24 PM
RE: Question about "MyStatus" - by CookieRevised on 01-17-2010 at 10:26 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-19-2010 at 08:19 AM
RE: Question about "MyStatus" - by stoshrocket on 01-19-2010 at 02:55 PM
RE: Question about "MyStatus" - by matty on 01-19-2010 at 03:29 PM
RE: Question about "MyStatus" - by Matti on 01-19-2010 at 04:55 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-19-2010 at 05:20 PM
RE: Question about "MyStatus" - by stoshrocket on 01-19-2010 at 07:52 PM
RE: Question about "MyStatus" - by CookieRevised on 01-19-2010 at 08:35 PM
RE: Question about "MyStatus" - by roflmao456 on 01-19-2010 at 10:58 PM
RE: Question about "MyStatus" - by CookieRevised on 01-19-2010 at 11:39 PM
RE: Question about "MyStatus" - by roflmao456 on 01-20-2010 at 02:47 AM
RE: Question about "MyStatus" - by 5n4k3 on 01-20-2010 at 11:20 AM
RE: Question about "MyStatus" - by Matti on 01-20-2010 at 12:27 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