User:Undefishin/nsb
WIP
This page will explain how to utilize NSB's tagging scripts to make complex tags and such.
There are a total of 41 working functions as of 2022, {math} doesn't work and {haste}'s gone.
Tag {commands}
Taken from https://gist.github.com/NotSoSuper/2d9efaadf18b288b84be05f2af0c1fd2#file-help-lua-L667-L720
{user} - Your username
{mention} - Your username#discrim
{discrim} - Your discriminator
{id} - Your ID
{nick} - Your nickname (username by default)
{server} - This server
{servercount} - Number of users on the server
{serverid} - The servers ID
{channel} - The name of the channel the tag was used
{channelid} - The id of the channel the tag was used (try <#{channelid}> for a mention)
{args} - All the text that came after the tag name
{arg:0} - A specific-numbered argument, starting at 0 for the first argument
{argslen} - The number of arguments
{avatar} - Your avatar URL
{randuser} - A random username from the server
{randonline} - A random online username on the server
{randchannel} - A random channel on the server
{choose:A|B|C} - A random item in the list
{range:1|100} - A random number
{replace:text1|with:text2|in:text3} - Replaces text, text1 can be a RegEx pattern
{upper:text} - UPPERCASE TEXT
{lower:text} - lowercase text
{url:text} - Converts URL to proper encoding
{math:4|+|5|%|6} - Computes values (valid oprations: |+| |-| |*| |/| |%|)
{if:{id}|=|130070621034905600|then:potato|else:idk} Valid Conditions/Comparisons: |=| (Equal) |<| (Less than) |>| (Greater than) |>=| (Greater/equal) |<=| (Less/equal) |~| (Ignore-case equal) |?| (Regex)
{set:variable|value} - Set a temporary variable to call later on in the tag
{get:variable} - Retrieves the value of a temporary variable
{note:text} - Comment, completely removed during parsing
{substring:text|start|end} - Take the substring of a text
{prefix} - Returns the first current bot prefix
{code:text} - Formats text into a code block
// Run code with tags!
{lua:print('1')} - Execute Lua Code or Functions
{lang:code} - Replace lang with any language from the "code" command to execute code
{nsfw} - Mark a tag as NSFW
{eval:text} - Reevaluates text (useful with {ignore})
{ignore:text} - Ignores script tags in text
{length:text} - Number of characters in text
{attach/file:url|filename (optional)} - Attaches an image (Ex: {attach:example.org/image.png})
{text:url} - Returns the text contents of the URL
{lattach} - Returns URL of the last attachment in chat
// Tag script to manipulate images using code.
{iscript:code/imagescript:code} - Image Script v1 https://gist.github.com/matmen/d4fa000110efe2944078fb8065dafd11#file-imagescript-md
// Math related
{abs}
{cos}
{e}
{max}
{min}
{pi}
{sin}
{tan}