Announcement

Collapse
No announcement yet.

Randomising!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Randomising!

    Is there a way of AMS generating a random number?

    eg I want to create a list of 'Tips for the day', then randomly select from the list (either in a .INI file or in the registry).

    If not random, i'd even be happy with a counter, to store an incrementing value every time the CD is run. Then recall this value and pick the corresponding tip.

    The only way I can see at the moment is a quick VB program to write the random seed, and run this whenever the CD starts.

    [Hint: to create a checkbox, create two graphics - one with an empty square and one with a 'check'. Standard graphic is the empty box, then show the 'checked' box on a mouse click event - at the same time set a variable '%checked%'. Then using a bit of boolean, you can return to unchecked next time the box is clicked. ie to disable my 'Tip of the day' once I've got it working ]

  • #2
    Re: Randomising!

    Set your menu so that the on project open it reads the registry for tip number. Then it would display a tip coresponding to that number if %checked% equlas checked. Then when you click close on the tip box, it would write a new value to the registry for the next tip number. Next time menu is run, it would read the new value, and show the new tip.

    IE. the menu reads a value of 1 as the tip number. It also reads %*check% as checked. It then SHOW OBJECT tip1. The user closes the chek box, which then writes a value of 2 as the tip number in the registry. Next time menu is ran, it reads a value of 2 and checked, then shows obect tip2.

    The explanation may kinda suck, but it should be pretty easy to do. Im adding this feature to mine, just haven't coded it yet
    . Good idea for the check box. I may have to steal it from you.

    Comment


    • #3
      Re: Randomising!

      Thanks dallas - good plan. Use the mouseclick event on a 'close' button, Tip1 text = "Hello this is tip one", Tip1Val=2.

      So...When Tip1Val is set, the next tip to load is '2', which has text of "Blah" and Tip2Val=3.

      It 'thinks' right, but I'll have to code it and see.

      Comment


      • #4
        Re: Randomising!

        If you need any help coding, let me know. I'll write it and email it to you. Remember registry is your friend. Use it to the fullest extent possible.

        Comment


        • #5
          Re: Randomising!

          Thanks dallas. I'll let you know how i get on. As far as i can see, two variables are needed for each tip - one with the text, and one with the next tip value, unless there's a way of doing math(s) in AMS.

          Comment


          • #6
            Re: Randomising!

            thats how im seeing ti for now. havent really played with it yet, but that would be easiest way

            Comment


            • #7
              Re: Randomising!

              ...or of course use the 'increment' option when modifying an existing registry key.

              Comment


              • #8
                Re: Randomising!

                at the last tip though, you would need it to set back to 1

                Comment


                • #9
                  Re: Randomising!

                  Hi dallas. Solved it using an ini file. mail me if you want to have a look at the ams file: [email protected]

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎