> For the complete documentation index, see [llms.txt](https://assurancetourix.gitbook.io/assurancetourix/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assurancetourix.gitbook.io/assurancetourix/customc/dshell/basic-keywords.md).

# Basic keywords

### <mark style="color:yellow;">if</mark> (condition)

can make any condition in the line.

```
if 12/4 < 5
sm "is smaller than 5"  :: command to send a message to the current channel
#if
```

All logical operator admite (every operator return [BOOL](/assurancetourix/customc/dshell/types.md#bool-boolean) value) :&#x20;

* `<` strict less than&#x20;
* `<=` or `=<` less or equal than&#x20;
* `=` strict equal than
* `!=` or `=!` not equal than
* `>` strict greater than
* `>=` or `=>` greater or equal than
* `and` two equal boolean return True
* `&` binnary operator AND
* `or` one value is True return True
* `|` binnary operator OR
* `in` firste value in the second value
* `not` reverse the result (only booleant value is accepted)

### <mark style="color:yellow;">elif</mark> (sub-condition)

Is executed sequentially if more than one elif is passed.

If the [main condition](#if-condition) is False, sub-condition was executed up to one return True value.

```
if 1 != 1
...
elif "bye" in "CustomC*"
...
elif 1 > 0.5
sm "this elif is true and was executed !"
#if
```

### <mark style="color:yellow;">else</mark>

Is executes if th main condition and all suv-condition was False.

```
if 1 != 1
...
elif 2 != 2
...
else
sm "no condition was True... :("
#if
```

### <mark style="color:yellow;">#if</mark> (close conditional block)

Keyword <mark style="color:$danger;">**REQUIRED.**</mark>

***

### <mark style="color:yellow;">loop</mark> (iterator)

loop can iterate [STR](/assurancetourix/customc/dshell/types.md#str-string), [LIST](/assurancetourix/customc/dshell/types.md#list-list) and [INT](/assurancetourix/customc/dshell/types.md#int-interger) type.

{% hint style="info" %}
The current value of the iterared is gived at an [IDENT](/assurancetourix/customc/dshell/types.md#ident-identificator) passed at the first position
{% endhint %}

On STR type, loop attribute each caracter to the gived ident

```
loop my_ident "my iterable string !"
    :: my_ident was each caracter
#loop
```

On LIST type, loop attribute each value of the list to the gived ident

```
loop my_ident [True, False, None]
    :: my_ident was each value in the list
#loop
```

On INT type, loop attribute each value from 0 to x-1

```
loop i 50
    :: repeat 50 times the code
    :: i was each number from 0 to i-1
#loop
```

### <mark style="color:yellow;">#loop</mark> (stop iterator)

Keyword <mark style="color:$danger;">REQUIRED</mark> at the end of a loop block.

{% hint style="warning" %}
If is missing, the loop doesn't repeat his block more than one time !
{% endhint %}

```
loop i 50

if i = 49
sm "it's done !"
#if

#loop
...
```

***

### <mark style="color:yellow;">#end</mark> (stop the program)

Stop the entire program

***

### <mark style="color:yellow;">var</mark> (variable)

Create a variable or reassign it

```
var my_variable 1   :: my_variable is now 1
var my_list ["Hello", "world !"]

sm "hello, world !"
var message_sent_channel __ret__  :: Message ID of the current message sent
```

All [type](/assurancetourix/customc/dshell/types.md) except [discord mention](/assurancetourix/customc/dshell/types.md#mention-all-discord-mention) can be assigned in a variable.

{% hint style="info" %}
You can make inline condition to asigne a variable.
{% endhint %}

```
var my_conditional_variable True if 5 > 2 else False

:: my_conditional_variable = True
```

***

### <mark style="color:yellow;">sleep</mark>

stop the program for a specified time

```
sleep 50  :: stop for 50 seconds
```

***

### <mark style="color:yellow;">param</mark> (parameters)

Setup all required arguments for the program

{% hint style="info" %}

* Set `"*"` value on a parameter to make it mandatory
* Add `*` after `--` to capture all words until the end of the line or before a new `--`. Parse words and put them in a [list](/assurancetourix/customc/dshell/types.md#list-list).
* Add `'` after `—` to capture all words until the end of the line or before a new `--`. Do not parse words, return a string contain all words captured.
  {% endhint %}

```
param
--member "*"     :: obligatory
--'reason "no reason specified"  :: not obligatory and have a default value specified.
#param
bm member --reason reason :: ban the specif
```

You can use `member` and `reason` [ident](/assurancetourix/customc/dshell/types.md#ident-identificator) in your code after.

### <mark style="color:yellow;">#param</mark> (close parameter block)

Close the parameter block.\
It's <mark style="color:$danger;">REQUIRED</mark> in the code if you open a parameter block.

```
param
--member "*"
--*reason no reason specified
#param  :: required !
```

### <mark style="color:yellow;">code</mark> (code block)

A code block can take Dshell code who can be executed after or passed in an UI.

It's like a "function" who can take arguments with the [eval](#eval) keyword.

code keyword <mark style="color:$danger;">required</mark> an [ident](/assurancetourix/customc/dshell/types.md#ident-identificator) to store the block.

```
code my_ident_code

loop i 3
sm "Code block executed !"
#loop

#code
```

### <mark style="color:yellow;">#code</mark> (close code block)

Close the code block.\
It's <mark style="color:$danger;">REQUIRED</mark> in the code if you open a code block.

### <mark style="color:yellow;">eval</mark>

Evaluate a code block like a "function".

eval keyword can pass arguments to the code block passed like : \
`eval my_code --my_argument "my data"`\
\
\
\
\ <br>

You MUST specify the argument name to pass data. `eval my_code "my data"` work but the message [ident](/assurancetourix/customc/dshell/types.md#ident-identificator) in the code block was not replaced by *"my data"*

eval keyword <mark style="color:$danger;">required</mark> an ident at this first argument who contain a code block.

```
code my_code
sm my_mesage
#code

eval my_code --my_message "Look my message !"
```

### <mark style="color:yellow;">return</mark>

Return a specified value in a [code](#code-code-block) block.

This returned value is the result of the keyword [eval](#eval).

```
code my_code

if `random` >= 0.5:                   :: random is a Dshell command to take a number [0;1)
return true
else
return false
#if

#code

eval my_code
if __ret__                            :: __ret__ take the result of the code block returned value
sm "it's true !"
else
sm it's false :'("
#if
```


---

# 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://assurancetourix.gitbook.io/assurancetourix/customc/dshell/basic-keywords.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.
