Scala - Digital Signage Software [Logo]
Languages: EnglishGermanPolishJapaneseNorwegianFrench
  Markets Products Partners Services Support About Us  
Scala Support Scala Celebrates 20 Years of Innovation and Leadership

Number Randomizer

Monday, 12/17/2007 -- by Martyn Cripps. Subject: Number Randomizer

Hi
Is there a basic script out there that I can get hold of to generate random numbers where I input the starting number and finishing number. Also, would it be possible to make sure that a number isn't repeated.

Many thanks

Martyn

Monday, 12/17/2007 -- by Thomas. Subject: ScalaScript

Scalascript casn be the simple answer.

On a page write down "!randomx" (without the "). Proceed to list view (on that page). Add a "special event". in "branch" define a variable. Write down: "randomx = Random(0,10)".

Play script. Now every second you will get a random number between the desired range of "0" to "10".

With ScalaScript and some boolean you can even tell a page not to show if a number already has been randomly selected.

Is that what you mean?

Thomas

Wednesday, 12/19/2007 -- by Martyn Jacey. Subject:

Hi Thomas
Thanks, but I am having a problem putting it into ICD. I also would like it to select a random number on a mouse click.

Regards

Martyn

Thursday, 12/20/2007 -- by Thomas. Subject: Details

Martyn,

some more details always do help a lot. In which ICD version? What will you do exactly?

Thomas

Thursday, 12/20/2007 -- by Martyn Jacey. Subject:

Hi Thomas

Sorry, it will be used on ICD3, although I did a test on ICD. It is for our Christmas draw on Sunday. We have sold aroud 1300 tickets, so the idea is to randomise numbers from 1-1300 say. What I want to be able to do is to click the mouse when I am ready to pick another number.

Hope this helps.

Kind Regards


Martyn

Friday, 12/21/2007 -- by Thomas. Subject: Try this

Hi Martyn,

with a random out of 1300 I think we don't have to care much about numbers already picked, there is a chance of 1:1300 to pick a number twice ;-)

try this script:

!ScalaScript
:"nextTicket.sca"
{
Group:
Integer(randomT);
BackgroundSettings(Size(640, 480), Grid(Off, Snap(On)));
Config.SaveOpts(SaveEditable(On));
Config.SaveEncoding("Auto");
Sequence:
{
      Group:
      Display(Backdrop(Pen(1)), Margin(24, 24, 0, 0), Tabs(Explicit(708, 720, 728, 737, 744, 751, 760)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd, $8fce39, $513a)));
      Text(160, 110, "THE NEXT TICKET ...", Face(On, Pen(2)), Shadow(On, Pen(21)), Align(Center, None), AntiAlias(On), Update(Normal), Font("Arial Fett (Western [<Arial> 700])", 35), Justify(Center, Top), Wrap(On, Width(456)));
      Pause.Milli(2000);
}
{
      Group:
      Display(Backdrop(Pen(1)), Margin(24, 24, 0, 0), Tabs(Explicit(708, 720, 728, 737, 744, 751, 760)), UserPalette(RGBPen(1, $0, $ffffff, $999999, $555555, $712068, $df449c, $dc110e, $662200, $ff5a00, $ff9c00, $ffee00, $8800, $dd00, $cccc, $66ff, $aa, $777777, $bbbbbb, $dddddd, $8fce39, $513a)));
      Text(160, 110, "THIS TICKET NUMBER HAS WON", Face(On, Pen(2)), Shadow(On, Pen(21)), Align(Center, None), AntiAlias(On), Update(Normal), Font("Arial Fett (Western [<Arial> 700])", 35), Justify(Center, Top), Wrap(On, Width(456)));
      Wait();
      Sequence:
      Text(160, 210, "!randomT", Wipe("ZoomUp", Direction(90)), Face(On, Pen(2)), Shadow(On, Pen(21)), Align(Center, None), AntiAlias(On), Update(Normal), Font("Arial Fett (Western [<Arial> 700])", 100), Justify(Center, Top), Wrap(On, Width(456)));
      randomT = random(1,1300);
}
}



Friday, 12/21/2007 -- by Martyn Jacey. Subject:

Thomas
Thanks for your patience. How do I paste this into scala mate.


Many thanks.

Sorry for being a pain.

Regards

Martyn

Sunday, 12/23/2007 -- by Thomas. Subject: copy&paste

Well,

just copy it from "!" to last "}". Open notepad. paste it, save it as "nextTicket.sca. Run it

Cheers,
Thomas


Back: LiveSportGraphics-Football

   Discussions 2005 Index   
(Page 4 of 230)

Next: PreLoad Content.

Additional Information
Request DVD - Concepts and demo
Contact Scala Sales
Search