Skip to content

Contribution Docs

This passage describes the expectations for those interested in submitting helper functions to this repository.

In this repository, .lua files are grouped based on general purpose and author. If a set of .lua files fulfill distinct purposes or are written by different authors, they receive separate folders. With that said, additions that are functionally similar to preexisting .lua files will typically not be accepted to avoid bloat. As long as your functions serve a distinct purpose from the functions that already exist, they are a welcome addition.
What counts as “functionally similar” is up to the discretion of repository managers.

Each folder is organized like so: first, your folder should have some title that connects and summarizes the behavior of the contained functions. For consistency, the folder’s name should be written with kebab-case. Then, within each folder, each function should be separated into its own lua file. Each file’s name should match the name of its function. Lastly, you should include an all.lua file which compiles all of the functions from the individual files inside of them.

  • Directorysrc/assets/code
    • Directorycheck-table/
    • Directorypulse Your folder name
      • all.lua Contains all functions below
      • pulse.lua
      • pulseBoth.lua
      • pulseLeft.lua
      • pulseRight.lua
    • Directorysplit-alpha/

Each of your script files should consist of a function, a comment with function documentation, and at least one example of its use. If your function requires constant variable definitions to work, you should include those too. Since Lua doesn’t have a standardized style guide, feel free to format your function as you choose. Conventional casing is preferred, however.

As for your documentation, you should use either Lua Language Server annotations or the following custom comment format:

-- TEMPLATE DOCUMENTATION FORMAT --
--[[
functionName(paramName, paramName, ...)
Description of what the function does
Implementation:
Additional functions, variables, or considerations necessary for adding this function to modfiles
Parameters:
- paramName: description / type of the parameter
- Additional parameter info
- ...
Returns:
- Return value / type and case of the return value (if it exists)
- ...
]]

Although the custom comment format is more readable in some instances, LLS documentation is popular and is therefore a valid alternative.

As for your use examples, simply call the function with all the necessary parameters. If your function returns a value, you may want to include multiple use instances that all return different things. Adding explanatory variables or comments may also be useful, but try to keep it concise.

Once you add your individual function files to the folder, you can now create an all.lua file containing all functions. Here’s a quick run-through of the assembly process:

  1. Create your all.lua file in the folder.

  2. Add your name and function tags to the top of the file. A list of valid tags can be found here.

    --Author: [AUTHOR NAME]
    --Tags: [TAGS]
  3. Add a comment with a free-use license such as the MIT License, filling your name into the proper fields.

    --[[
    MIT License
    Copyright (c) 2026 [AUTHOR NAME]
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
    ]]
  4. Add the constants, functions, and function documentation from each file into the all.lua file. Be mindful of your Implementation limitations as you combine the functions into one script.

    • Please do not transfer the examples.

Once you’ve added your functions to the repository, you can then update helper-functions.mdx with your code and some additional information. This information includes a summative title for your helper functions, your author name, formatted tags, and a brief description of your code’s functionality and potential use cases.

### [TITLE]
***Author:* [AUTHOR NAME]**
<Badge text="[BADGE NAME]" variant="note" /><Badge text="[...]" variant="note" />
[FUNCTION DESCRIPTION]
import [SCRIPT VAR] from '../../../assets/code/[FOLDER NAME]/[SCRIPT NAME].lua?raw'
<Tabs>
<TabItem label="[SCRIPT NAME]">
<Code code={[SCRIPT VAR]} lang="lua" title = {"[SCRIPT NAME]"}/>
</TabItem>
*Copy the TabItem and add another import statement to have multiple scripts under the same Tab object.*
</Tabs>

Tags are used to help charters look through the Helper Function Heap page. The following tags are all valid for your helper function set.

TagDescription
EventsAny helper functions that use events
(ie. call xdrv.RunEvent).
Chart ModsAny helper functions that primarily use chart mods
(ie. call xdrv.Set or xdrv.Ease w/o an Id param).
Note ModsAny helper functions that primarily use note mods
(ie. call xdrv.Set or xdrv.Ease w/ a Id param).
AlphaAny helper functions that interact with the alpha values of backgrounds.
BloomAny helper functions that interact with the bloom of backgrounds.
DataAny helper functions that process Lua data.

Thank you for expressing interest in adding helper functions to this charting guide! If you need any help, feel free to reach out to me via Discord (theblockiest).