# ChardScript For Loops

### ChardScript For Loops

A **for** loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.

**Example**

The increment is 1:

{% code lineNumbers="true" %}

```renpy
for i=0 to 5 then
  echo(i)
end
```

{% endcode %}

### Custom increment For Loops

**Example**

The increment is 2.5:

{% code lineNumbers="true" %}

```renpy
for i=0 to 5 step 2.5 then
  echo(i)
end
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://gamingmod.gitbook.io/chardscript-docs/chardscript-tutorial/chardscript-for-loops.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
