Randomization

Conditional example for understanding.

In the incoming stream, the question “How are you?” is generated. Next, I want to get one of the answer options in the proportion of 75/25:

  • Good (option A) 75%
  • Bad (option B) 25%

The script shown in the screenshot below will produce 8 randomized answers at once.

How are you?

  • Good
  • Good
  • Bad
  • Good
  • Good
  • Bad
  • Good
  • Good

And I need the script to stop after issuing one of the answer options (good / bad).

How are you?

  • Good

Running the script again would generate another randomized response.

How are you?

  • Bad

etc.

This is what the solution looks like.

And this is the blueprint of this solution.

blueprint (25).json (10.9 KB)

But there is a caveat to this decision. It gives out all 8 randomized options at once.

How to make it so that after issuing one of the answer options, the scenario stops?

@Rory Please share a screen recording to understand at which stage you wish to stop the scenario.

MSquare Support
Visit us here
Youtube Channel

Here is the screencast.

Step 1 is the publication of a message in the telegram channel.

Step 2 is sleep.

Step 3 is the randomization of the further development of events in the proportion of 75/25.

Option A is the publication of a message in the telegram channel.

Option B is also the publication of a message in the telegram channel.

In the current version of the scenario, after step 3, 8 messages are immediately published in the telegram channel, including option A and B (in the proportion of 75/25).

I need only one message to be published in the telegram channel (A or B) after step 3. After that, the scenario should stop.

The next time you run the scenario after step 3, only one message (A or B) should be published again in the telegram channel.

As a result, if we run the scenario 8 times, then we should get:

1 Posting a message in the telegram channel (step 1) + one more message (option A or B)
.
.
.
8 Posting a message in the telegram channel (step 1) + one more message (option A or B)

Options A and B should be distributed in the proportion of 75/25 (A - 75 / B - 25).

Here is the blueprint of the full scenario.

blueprint.json (47.3 KB)