> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/text-and-number/random-number.md).

# Random number

随机数是用于生成一个在设定的最小值和最大值之间的整数的动作，然后将结果保存到一个输出变量中。

这个动作通常用于生成模拟数据（年龄、想要交朋友的数量）、随机选择一行数据，或者根据您自己的逻辑创建灵活的随机等待时间。

🎥 查看更多教程视频：[在这里](https://youtu.be/nlEQsaxawt4)。

#### 配置参数：

* Min：可以获得的最小数值。
* Max：可以获得的最大数值。
* Output variable：保存刚刚生成的随机数的变量名称。

#### 实际例子：随机选择要互动的文章数量

在管理社交媒体账户时，为了避免任何账户都浏览相同数量的文章而引起系统的怀疑，您应该让每个账户与随机数量的文章互动。

* 配置方法：您调用随机数动作，设置 Min 为 `3`，Max 为 `7`，并将 *Output variable* 设置为 `$randomPosts`。
* 结果：当流程运行到这一步时，系统将随机抽取一个在 3 到 7 之间的数字（例如：Profile 1 抽到数字 `4`，Profile 2 抽到数字 `6`）。您只需将变量 `$randomPosts` 传递到后面的 For 循环的 End 中，每个账户将自动浏览并互动其抽到的独特次数。

<figure><img src="/files/HzHE5BwVmP42wTnHSB75" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/text-and-number/random-number.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
