What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Question] Randomizing captions

[Question] Randomizing captions
Author: Message:
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
O.P. [Question] Randomizing captions
Edit: I meant radio control

Just a quick question (I'm just learning Jscript, so be nice), here's what I have:

1 Window with 4 radio controls defined in my XML file (Resp0, Resp1, Resp2, Resp3)

1 array (thecapt) with 10 strings called ("Blah 1", "Blah 2", "Blah 3", "Blah 4", "Blah 5" etc...)

What I need is to be able to load 4 strings from this array into the 4 radio controls at runtime - at the moment I can load the first 4 strings, however for the script to work the strings from the array need to be randomly selected (and not repeated in another radio control). I don't know how to explain really so heres a kinda example..

Run 1:

    O Blah 1
    O Blah 3
    O Blah 4
    O Blah 2

Run 2:

    O Blah 3
    O Blah 4
    O Blah 2
    O Blah 1

Etc... (each O is supposed to represent a radio control btw)

At the moment the code to fill the radio controls (in order) is as follows:

code:
    iwnd = MsgPlus.CreateWnd("Interface.xml","WndReply")
   
    var i
    for (i=0; i< 4; i++)
    {
        iwnd.SetControlText ("Resp"+[i], thecapt[i])
    }


Any help on how to do this is appreciated, I'm NOT asking you to write the code for me (unless you really want to :P) but any pointers in the right direction as to how to go about this would be appreciated :)

Ps:

I also have this code in the script to generate a random number between 0 and a user defined highest number. Dunno if this is of any use in my problem, but I'll include it here anyway:

code:
function RandNo(TopNo)
{
    return Math.floor(Math.random() * TopNo);
}

This post was edited on 06-29-2006 at 09:30 PM by pollolibredegrasa.
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
06-29-2006 07:04 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Question] Randomizing captions - by pollolibredegrasa on 06-29-2006 at 07:04 PM
RE: [Question] Randomizing captions - by RaceProUK on 06-29-2006 at 09:39 PM
RE: [Question] Randomizing captions - by pollolibredegrasa on 06-29-2006 at 10:57 PM
RE: [Question] Randomizing captions - by RaceProUK on 06-30-2006 at 11:49 AM
RE: [Question] Randomizing captions - by pollolibredegrasa on 06-30-2006 at 01:43 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