> 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).

# 随机数字

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

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

#### 配置参数：

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

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

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

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


---

# 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.
