# MoonSec V3 Obfuscator Macros

## \<string> MS\_ENCRYPT(\<string>)

Encrypts given string, alternatively you can use **ENCRYPT:** prefix too.

```lua
print(MS_ENCRYPT('Hello World'));
local a = MS_ENCRYPT([[Oh god]]);
print(a, "ENCRYPT:Another hello world");


```

{% hint style="warning" %}
This macro uses a big algorithm to decrypt strings, so it is not recommended on frequently used strings as it will decrease performance
{% endhint %}

## \<void> MS\_WATERMARK(\<string>)

Changes the watermark on output files, and it will break the script if that watermark is somehow removed.

```lua
MS_WATERMARK('SkiddedSS - Join us discord.gg/ğ')
print('hello world');
```

{% hint style="info" %}
By default, this is`MS_WATERMARK([[This file was protected with MoonSec Private by Federal#9999]])`
{% endhint %}

{% hint style="warning" %}
You can't pass a variable to this macro, because it is not actually a function defined in the code. The watermark gets replaced at parsing process, and function call gets removed from your code automatically.
{% endhint %}

## \<void> MOONSEC\_EXIT()

Kills the interpreter and ends the script execution immediately, with all sub-threads.&#x20;

```lua
-- example threads:
for i=1,15 do
    spawn(function() 
        while wait(1) do 
            print'x' 
        end 
    end)
end

print('bye bye');
MOONSEC_EXIT();
print('this will never be printed');

```

## \<number> MOONSEC\_GET\_SCRIPT\_ID()

This is an unique script identifier fingerprint, and it changs between every obfuscated file. IDs have a range between `111111111` and `999999999`

```lua
print(MOONSEC_GET_SCRIPT_ID())
```

##


---

# 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://cmoonm4n.gitbook.io/moonsec-v3-docs/master.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.
