Skip to content
Svarii edited this page Jul 18, 2025 · 21 revisions

GreyScript

GreyScript Prime is an extension for Grey Script that adds additional methods for object manipulation. With the combination of Greybel VS, Plant UML, and Markdown Preview Enhanced with litvis, this tool is designed to enhance your coding efficiency in VSCode.

file_append diagram

Table of Contents

🅰️ Text Mesh Pro Methods
🔢 Number Methods
📋 List Methods
🗂️ Map Methods
📁 File Management Functions
⚙️ Task Functions

🅰️ Static Badge

align

📝 Description

Modifies a text string to wrap it in the <align> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
alignment string Accepted values: left, center, right, justified, flush
closeTag boolean Whether to close the tag with a matching </align>; accepted: true/false

⚙️ Defaults

Parameter Default Value
alignment "center"
closeTag true

🔁 Return

string — the string value embedded in (or preceded by) the <align> tag.


💡 Examples

newString = "Hello"
    result = newString.align("center")
    print result 

// Output: <align="center">Hello</align>
newString = "Hello"
    result = newString.align("center", false)
    print result 

// Output: <align="center">Hello

🔗 Links

🧠 Notes

  • ⚠️ Parameters are not validated.
    • ⚠️ alignment will not reject invalid values → Return: string<withParseIssues>
    • ⚠️ closeTag will not reject invalid values → Return: null
  • 🛈 If all parameters are invalid → Return: null

alpha

📝 Description

Modifies a text string and prepends it with the <alpha> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
hexOpacity string Accepted values: 2-digit HEX value preceded by # (e.g., #4C)

⚙️ Defaults

Parameter Default Value
hexOpacity #FF

🔁 Return

string — the string value preceded by the <alpha> tag.


💡 Example

newString = "Hello"
    result = newString.alpha("#4C")
    print(result)

// Output: <alpha=#4C>Hello
newString = "Hello"
    result = newString.alpha
    print(result)

// Output: <alpha=#FF>Hello

🔗 Links

🧠 Notes

  • hexOpacity checked for type
  • hexOpacity checked for proper format
    • ⚠️hexOpacity will not reject invalid values → Return: string<withParseIssues>
  • 🛈 This tag does not apply a closing tag; it affects all text that follows
  • 🛈 If no parameter is passed, it applies default opacity #FF (fully opaque)

bold

📝 Description

Modifies a text string and wraps it within the <b> tag.
Used to apply bold styling in Text Mesh Pro.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — the string value embedded in the <b> tag.


💡 Example

newString = "Hello"

result = newString.bold
print(result)
// Output: <b>Hello</b>

🔗 Links


color

📝 Description

Modifies a text string by wrapping it within the <color> tag.
Used to apply a specified color to the string, supporting both hex formats and standard HTML color names.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
colorValue string The desired color in hex format: #RRGGBB, #RRGGBBAA, or standard HTML color name (e.g., "blue", "Aquamarine")

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

string — the string value embedded in the <color> tag.


💡 Example

newString = "Hello"

result = newString.color("blue")
print result
// Output: <color=blue>Hello</color>

result = newString.color("#FFFFFF")
print result
// Output: <color=#FFFFFF>Hello</color>

result = newString.color("Aquamarine")
print result
// Output: <color=#7FFFD4>Hello</color>

🔗 Links

🧠 Notes

  • Color names are case sensitive
  • Blue and blue, green and Green, are different colors

cspace

📝 Description

Modifies a text string by wrapping it within the <cspace> tag.
Used to control character spacing in text renderers such as Text Mesh Pro.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
charSpacing string The amount of spacing to apply, e.g. "1em" or "5px"
closeTag boolean Whether to close the tag with </cspace> — accepted values: true or false

⚙️ Defaults

Parameter Default Value
charSpacing 1em
closeTag true

🔁 Return

string — The string value wrapped within the <cspace> tag.


💡 Example

newString = "Hello"

result = newString.cspace
print result
// Output: <cspace=1em>Hello</cspace>

🔗 Links

🧠 Notes

  • Accepts pixel font unit or percentage values (e.g., px, em, %)

indent

📝 Description

Modifies a text string to wrap it in the <indent> tag for use with supported rich text renderers (e.g., Text Mesh Pro).

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
indentPercent string Optional. Accepted input: em, px, or % units.
closeTag boolean Optional. Whether to append a closing </indent> tag. Accepted: true or false.

⚙️ Defaults

Parameter Default
indentPercent 15%
closeTag true

🔁 Return

string — the string value embedded in (or appended to) the <indent> tag.


💡 Example

newString = "Hello"
    result = newString.indent
    print(result)

// Outputs: <indent=15%>Hello</indent>
newString = "Hello"
    result = newString.indent("3em")
    print(result)

// Outputs: <indent=3em>Hello</indent>
newString = "Hello"
    result = newString.indent("25px", false)
    print(result)

// Outputs: <indent=25px>Hello

🔗 Links

🧠 Notes

  • Parameters are not checked for validity.
  • indentPercent will not reject invalid values → Return: string<withParseIssues>
  • closeTag will not reject invalid values → Return: null
  • If all parameters are invalid → Return: null

italic

📝 Description

Modifies a text string by wrapping it within the <i> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string value wrapped within the <i> tag.


💡 Example

newString = "Hello"

result = newString.italic
print(result)
// Outputs: <i>Hello</i>

🔗 Links


line-indent

📝 Description

Modifies a text string to wrap it in the <line-indent> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
indentPercent string Optional. Accepted input: em, px, or %.
closeTag boolean Optional. Whether to append a closing </line-indent> tag. Accepted: true or false.

⚙️ Defaults

Parameter Default
indentPercent 15%
closeTag true

🔁 Return

string — The string value embedded in (or appended to) the <line-indent> tag.


💡 Example

newString = "Hello"
    result = newString.line-indent
    print(result)

// Outputs: <line-indent=15%>Hello</line-indent>
newString = "Hello"
    result = newString.line-indent("3em")
    print(result)

// Outputs: <line-indent=3em>Hello</line-indent>
newString = "Hello"
    result = newString.line-indent("25px", false)
    print(result)

// Outputs: <line-indent=25px>Hello

lowercase

📝 Description

Modifies a text string by wrapping it within the <lowercase> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete
---

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string value wrapped within the <lowercase> tag.


💡 Example

newString = "Hello"

result = newString.lowercase
print(result)
// Outputs: <lowercase>Hello</lowercase>

🔗 Links


margin

📝 Description

Modifies a text string by wrapping it within the <margin> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
margin string Optional. Accepted values: em, px, or %.

⚙️ Defaults

Parameter Default
margin 5em

🔁 Return

string — The string value wrapped within the <margin> tag.


💡 Example

newString = "Hello"

result = newString.margin
print(result)
// Outputs: <margin=5em>Hello</margin>

🔗 Links


mark

📝 Description

Modifies a text string by wrapping it within the <mark> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete
---

🧮 Parameters

Name Type Description
color string Optional. HEXA color value (#RRGGBBAA).

⚙️ Defaults

Parameter Default
color #FFFF00AA

🔁 Return

string — The string value wrapped within the <mark> tag.


💡 Example

newString = "Hello"

result = newString.mark
print(result)
// Outputs: <mark="#FFFF00AA">Hello</mark>

🔗 Links


mspace

📝 Description

Modifies a text string by wrapping it within the <mspace> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
monospace string Optional. Accepted values: em, px, or %.

⚙️ Defaults

Parameter Default
monospace 2.75em

🔁 Return

string — The string value wrapped within the <mspace> tag.


💡 Example

newString = "Hello"

result = newString.mspace
print(result)
// Outputs: <mspace="2.75em">Hello</mspace>

🔗 Links


nobr

📝 Description

Modifies a text string by wrapping it within the <nobr> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string value wrapped within the <nobr> tag.


💡 Example

newString = "Hello"

result = newString.nobr
print(result)
// Outputs: <nobr>Hello</nobr>

🔗 Links


noparse

📝 Description

Modifies a text string by wrapping it within the <noparse> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string value wrapped within the <noparse> tag.


💡 Example

newString = "Hello"

result = newString.noparse
print(result)
// Outputs: <noparse>Hello</noparse>

🔗 Links


page

📝 Description

Modifies a text string by appending the <page> tag to the end.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string value with the <page> tag appended to the end.


💡 Example

newString = "Hello"

result = newString.page
print(result)
// Output: Hello<page>

🔗 Links


pos

📝 Description

Modifies a text string by prepending it with the <pos> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
position string Optional. Default: "50%"

⚙️ Defaults

Parameter Default
position "50%"

🔁 Return

string — The string prepended with the <pos> tag.


💡 Example

newString = "Hello"

result = newString.pos
print(result)
// Output: <pos=50%>Hello

🔗 Links


rotate

📝 Description

Modifies a text string by wrapping it within the <rotate> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
degreesRotation string Optional. Default: "45"

⚙️ Defaults

Parameter Default
degreesRotation "45"

🔁 Return

string — The string rotated with the <rotate> tag.


💡 Example

newString = "Hello"

result = newString.rotate
print(result)
// Output: <rotate="45">Hello </rotate>

🔗 Links


size

📝 Description

Modifies a text string by wrapping it within the <size> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
textSize string Optional. Default: "5em"

⚙️ Defaults

Parameter Default
textSize "5em"

🔁 Return

string — The string wrapped within the <size> tag.


💡 Example

newString = "Hello"

result = newString.size
print(result)
// Output: <size="5em">Hello </size>

🔗 Links


strike

📝 Description

Modifies a text string by wrapping it within the <s> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string wrapped within the <s> tag.


💡 Example

newString = "Hello"

result = newString.strike
print(result)
// Output: <s>Hello</s>

🔗 Links


sub

📝 Description

Modifies a text string by wrapping it within the <sub> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string wrapped within the <sub> tag.


💡 Example

newString = "Hello"

result = newString.sub
print(result)
// Output: <sub>Hello</sub>

🔗 Links


sup

📝 Description

Modifies a text string by wrapping it within the <sup> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string wrapped within the <sup> tag.


💡 Example

newString = "Hello"

result = newString.sup
print(result)
// Output: <sup>Hello</sup>

🔗 Links


underline

📝 Description

Modifies a text string by wrapping it within the <u> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string wrapped within the <u> tag.


💡 Example

newString = "Hello"

result = newString.underline
print(result)
// Output: <u>Hello</u>

🔗 Links


uppercase

📝 Description

Modifies a text string by wrapping it within the <uppercase> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The string wrapped within the <uppercase> tag.


💡 Example

newString = "Hello"

result = newString.uppercase
print(result)
// Output: <uppercase>Hello</uppercase>

🔗 Links


voffset

📝 Description

Modifies a text string by wrapping it within the <voffset> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
verticalOffset string Optional. Accepted input: em, px, or %.

⚙️ Defaults

Parameter Default
verticalOffset 1em

🔁 Return

string — The string value wrapped within the <voffset> tag.


💡 Example

newString = "Hello"

result = newString.voffset
print(result)
// Outputs: <voffset=1em>Hello</voffset>

🔗 Links


width

📝 Description

Modifies a text string by wrapping it within the <width> tag.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
width string Optional. Accepted input: em, px, or %.

⚙️ Defaults

Parameter Default
width "50%"

🔁 Return

string — The string value wrapped within the <width> tag.


💡 Example

newString = "Hello"

result = newString.width
print(result)
// Outputs: <width=50%>Hello</width>

🔗 Links


Logic Methods

.extract

The .extract method allows you to extract the text between the provided values

image

newString = "<b>0x53C737</b>"

print(newString.extract_between("<b>", "</b>")) // Outputs: 0x53C737

.format

The .format method allows for string interpolation

image

// Modification of implimentation by dynobytes.
variableString = "The quick brown %s jumps over the lazy %s"
animalsList = ["fox", "dog"]      
sentence = variableString.format(animalsList)
print(sentence); // Outputs: The quick brown fox jumps over the lazy dog

Removal Methods

.remove_char_last

The .remove_char_last method allows you to remove the last character to the given text. Example usage:

image

newString = "Hello"

print(newString.remove_char_last) // Outputs: Hell

.remove_char_first

The .remove_char_first method allows you to remove the last character to the given text. Example usage:

image

newString = "Hello"

print(newString.remove_char_first) // Outputs: ello

.remove_bold

The .remove_bold method allows you to remove bold tags from the given text. Example usage:

image

newString = "<b>Hello</b>"

print(newString.remove_bold) // Outputs: Hello

.remove_italic

The .remove_italic method allows you to remove italic tags from the given text. Example usage:

image

newString = "<i>Hello</i>"

print(newString.remove_italic) // Outputs: Hello

.remove_underline

The .remove_underline method allows you to remove underline tags from the given text. Example usage:

image

newString = "<u>Hello</u>"

print(newString.remove_underline) // Outputs: Hello

.remove_strike

The .remove_strike method allows you to remove strikethrough tags from the given text. Example usage:

image

newString = "<s>Hello</s>"

print(newString.remove_strike) // Outputs: Hello

.remove_mark

The .remove_mark method allows you to remove mark tags from the given text. Example usage:

image

newString = "<mark>Hello</mark>"

print(newString.remove_mark) // Outputs: Hello

.remove_sub

The .remove_sub method allows you to remove sub tags from the given text. Example usage:

image

newString = "<sub>Hello</sub>"

print(newString.remove_sub) // Outputs: Hello

.remove_sup

The .remove_sup method allows you to remove superscript tags from the given text. Example usage:

image

newString = "<sup>Hello</sup>"

print(newString.remove_sup) // Outputs: Hello

🔢 Static Badge

Static Badge

.clamp

The .clamp method allows a number to be clamped within a specified range image

.diff

The .diff method calculates the absolute difference between the current number and another number. image

newNumber = 44
newNumber2 = 2

result = newNumber.diff(newNumber2)
print(result) // Outputs: 42

.divide

The .divide method divides the current number by another number. Zero division will result in null image

newNumber = 84
newNumber2 = 2

result = newNumber.divide(newNumber2)
print(result) // Outputs: 42

.is_more

The .is_more method checks if the current number is greater than a provided number. Returns true if greater, false otherwise. image

myNumber = 42
myNumber2 = 100

result = myNumber.greater_than(myNumber2)
print(result) // Outputs: 0 (false)

.is_less

The .is_less method checks if the current number is less than a provided number. Returns true if lesser, false otherwise. image

myNumber = 42
myNumber2 = 100

result = myNumber.lesser_than(myNumber2)
print(result) // Outputs: 1 (true)

.lerp

The .lerp method computes the linear interpolation (lerp) between two numbers. image

.minus

The .minus method allows you to subtract a specified amount from a number. If no amount is provided, it defaults to 1. image

newNumber = 44

result = newNumber.minus(2)
print(result) // Outputs: 42

.multiply

The .multiply method multiplies the current number the given number (or 2). image

newNumber = 21
newNumber2 = 2

result = newNumber.multiply(newNumber2)
print(result) // Outputs: 42

.plus

The .plus method allows you to add a specified amount to a number. If no amount is provided, it defaults to 1. image

newNumber = 40

result = newNumber.plus(2)
print(result) // Outputs: 42

.random_from

The .random_from method generates a random number in the range of 1 (or optional parameter) to number. image

myNumber = 42
myNumber2 = 100

result = myNumber.lesser_than(myNumber2)
print(result) // Outputs: 1 (true)

.saturate

The .saturate Clamps a number to the normalized range [0, 1]. image


📋 Static Badge


.crop

The .crop method Returns a new list stripped of any spacing at the beginning and ending. If any value gets passed that is not a list this method will return null.

image

myList = ["", "string", "string", "", ""]

result = myList.trim
print(result) // Outputs: ["string", "string"]

.print

The .print method loops through a list and prints each item

image

myList = ["string", "string"]
myList.print

// Outputs:
string
string

🗂️ Static Badge

.get_attributes

image


📄 Functions Overview

bool_text

📝 Description

Converts a boolean-like value (true, false, 1, 0) into a string: "true" or "false".

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
boolVal flag A boolean or number (0 or 1) to be converted to a string.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

string — Returns "true" or "false" if the value is valid. Returns null for invalid input.


💡 Examples

print(bool_text("true"))
// Output: null
print(bool_text(true))
// Output: "true"
print(bool_text(1))
// Output: "true"
print(bool_text(0))
// Output: "false"
print(bool_text(-1))
// Output: "false"
print(bool_text(false))
// Output: "false"
print(bool_text(object))
// Output: null

🧠 Notes

  • Parameters are not checked for validity.
  • Invalid input (including strings or objects) returns null.
  • Negative numbers return "false".

extractIP

📝 Description

Scans a string for a valid IPv4 address and returns the first match.
Returns null if no valid IP address is found.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
inputString string The text string to search for an IP address.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

string | null — The first matching IPv4 address, or null if none is found.


💡 Example

print(extractIP("My IP is 192.168.1.5"))
// Output: 192.168.1.5

print(extractIP("No IP here"))
// Output: null

print(extractIP("IPs: 10.0.0.1, 172.16.0.1"))
// Output: 10.0.0.1

🧠 Notes

  • Uses a regular expression to identify IPv4 patterns.
  • Only the first valid match is returned.

file_append

📝 Description

Appends data to an existing file, or creates a new file if the file does not exist.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
savePath string Directory path to the file.
saveFile string Name of the file to append to.
newText string Text to append into the file.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

void — No return value.


💡 Example

dataString = "0xFC45B2XR9:missspeling"

file_append("/DatabaseDir", "addressData.db", dataString)
// Appends dataString to addressData.db in /DatabaseDir

🧠 Notes

  • Parameters are not validated.
  • If the file does not exist, it will be created.

file_delete

📝 Description

Delete a specified file if it has write permissions.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
filePath string Path to the directory containing the file.
fileName string Name of the file to delete.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

booleantrue if the file has write permission; false if not.
🛈 This does not verify that the file exists or was successfully deleted.


💡 Example

file_delete("/DatabaseDir", "addressData.db")
// Deletes the file if write permission exists

🧠 Notes

  • Only checks for write permission.
  • Does not confirm file existence or successful deletion.
  • Parameters are not validated.

file_exists

📝 Description

Check to see if the specified file exists.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
filePath string Path to the directory to search.
fileName string Name of the file to check for.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

booleantrue if the file is found, otherwise false.


💡 Example

file_exists("/DatabaseDir", "addressData.db")
// return true if found, otherwise false

🧠 Notes

  • Parameters are not validated.

🗃️ file_location_ident

📝 Description

Creates and returns a structured object containing file identification attributes derived from a provided absolute file path.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Not yet implemented

🧮 Parameters

Name Type Description
absoluteLocation string Full absolute file path to the target file

🚫 Defaults

Parameter Default Value
absoluteLocation (None)

🔁 Return

📦 map<string, string> — a map object containing file identifier attributes.

🗺️ Map Keys

Key Type Description
.ext string File extension (e.g., so, txt)
.name string Base file name without extension
.filename string Complete file name including extension
.dir string Full directory path of the file
.parentdir string Immediate parent directory name
.location string Original absolute location (input value)

💡 Example

aptClientID = file_location_ident("/lib/aptclient.so")

print(aptClientID.filename)   // Output: aptclient.so
print(aptClientID.location)   // Output: /lib/aptclient.so
print(aptClientID.ext)        // Output: so
print(aptClientID.name)       // Output: aptclient

🧠 Notes

  • ⚠️ Parameters are not validated for type. Improper types can cause runtime errors:
    • Passing a number:
      "Runtime Error: Key Not Found: 'lastIndexOf' not found in map"
    • Passing a map:
      "Runtime Error: Key Not Found: 'lastIndexOf' not found in map"
  • Always pass a properly formatted string path.

file_new

📝 Description

Create a new file at the specified path if it does not already exist.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
filePath string Path to the directory.
fileName string Name of the new file to create.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

void — This function does not return any value.


💡 Example

file_new("/DatabaseDir", "addressData.db")
// Creates a file at the specified location

🧠 Notes

  • File permissions are not checked.
  • Parameters are not validated.

force_params

📝 Description

Specifies usage information and checks if the required number of parameters have been passed. If not, the script exits and displays the usage message.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
usage string The usage string to display if validation fails.
minReqParams number Minimum number of required parameters.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

void — This function does not return any value.
🛈 Terminates the script early if the parameters do not meet requirements.


💡 Example

force_params("myApp [ipAddress] [port#]", 2)

get_exploit_address_list

📝 Description

Scan a library for vulnerable addresses.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
libLocation string Remote IP address or local absolute file location.
metaxploitObject map<string, function> Metaxploit library object.
remoteTarget flag (optional) Optional flag indicating if the target is remote. Default: false.
targetPort number (optional) Optional target port number. Default: 0.

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

list<string> — List of vulnerable addresses found.


💡 Example

libLocation = params[0]
metax = include_lib("/lib/metaxploit.so")

print find_exploitable_addresses(libLocation, metax)

fetch_exploit_requirements

📝 Description

Scans a target library using metaxploit.scan_address and a list of known vulnerable addresses.
Returns a list of structured maps with exploit requirement metadata for each address.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Requires:
    • function: unsafe_check_list() @ v0.0.1+
    • method: list.crop() @ v0.0.1+
  • Unit Testing: ❌ Not implemented

🧮 Parameters

Name Type Description
addressList list<string> List of addresses returned by metaxploit.scan()
libLocation string Library location those addresses were found in
metaxploitObject map<metaxploitLib> A Metaxploit object reference
remoteTarget flag (optional) Whether to scan the library remotely
targetPort number (optional) Port used to access the remote target

🚫 Defaults

Parameter Default Value
remoteTarget false
targetPort 0

🔁 Return

list<map<string, string>> — Each item represents an exploit requirement set for an address.

🗺️ Map Keys

Key Type Description
.address string Memory address being checked
.variable string Target variable at the address
.cra string Root access required
.cua string User access required
.cga string Guest access required
.rpf string Required port forwards
.rur string Required users registered
.is_patched string "true" or "false" — if exploit is patched
.version string Version of the discovered software/lib

💡 Example

scanLibLocation = "/lib/aptclient.so"
metaxLocation = "/lib/metaxploit.so"

metax = include_lib(metaxLocation)
exploitAddressList = find_exploitable_addresses(scanLibLocation, metax)

exploitReq = fetch_exploit_requirements(exploitAddressList, scanLibLocation, metax)

print exploitReq[0].address + ":" + exploitReq[0].variable

🧠 Notes

  • Parameters are not type-checked — passing a wrong type may lead to runtime errors.
  • Return values are all strings, including booleans like .is_patched.

fetch_whois

📝 Description

Pulls WHOIS information for a public IP address and returns a structured map of related metadata including administrative contact, domain, and network info.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
routerPublicIPAddress string The public-facing IP address to be queried via WHOIS lookup

🚫 Defaults

Parameter Default Value
routerPublicIPAddress (None)

🔁 Return

map<string, string> — a structured map of WHOIS attributes or an error object.

🗺️ Map Keys

Key Type Description
.admin string The administrative contact's name
.domain string The domain name associated with the IP
.email string Email of the administrative contact
.phone string Phone number for the administrative contact
.network string The network name or ID (if found)
.error string Return String on Error or false

💡 Example

whoisInfo = fetch_whois(params[0])

print whoisInfo.domain
print whoisInfo.admin
print whoisInfo.email
print whoisInfo.phone
print whoisInfo.network

🧠 Notes

  • If the IP address is local (LAN), the function returns an error object.
  • If the IP is not valid, a validation error is returned instead.
  • The returned network field will show [ UNKNOWN ] if fewer than 5 WHOIS lines exist.

file_location_ident

📝 Description

Creates a structured map of file identification attributes from an absolute file path.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
absoluteLocation string Absolute file path to extract info from.

🚫 Defaults

Parameter Default Value
absoluteLocation (None)

🔁 Return

map<string, string> — a map object populated with file metadata.

🗂️ Map Keys

Key Type Description
.ext string File extension
.name string File name without extension
.filename string Full file name
.dir string Directory the file is located in
.parentdir string Parent directory name
.location string Full absolute file path

💡 Example

aptClientID = file_location_ident("/lib/aptclient.so")

print(aptClientID.filename)  // Output: aptclient.so
print(aptClientID.location)  // Output: /lib/aptclient.so
print(aptClientID.ext)       // Output: so
print(aptClientID.name)      // Output: aptclient

⚠️ Footnotes

  • Parameters are not validated.
  • Passing an invalid type for absoluteLocation will cause runtime errors:
    • number: `"Runtime Error: Key Not

get_acks

📝 Description

Calculates the recommended number of ACKs to collect based on signal strength.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
signalStrength number Signal strength value (default is 1).

⚙️ Defaults

Parameter Default
signalStrength 1

🔁 Return

number — Recommended number of ACKs to collect.


💡 Example

reqACK = get_acks(6) // Signal Strength 6%
print(reqACK) // Output: 14286

get_inbox

📝 Description

Logs into the mail account and fetches inbox messages.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
mailPass string (Optional) Password for the email account.
mailAddress string (Optional) Email address to log in with. Defaults to user_mail_address.

⚙️ Defaults

Parameter Default
mailAddress (Optional) user_mail_address
mailPass (Optional) null

🔁 Return

object — Inbox messages fetched from the mail server.
🛈 Returns null if mailPass is not provided.


💡 Example

inbox = get_inbox("mypassword", "user@example.com")
print(inbox)

get_random_ip

📝 Description

Generate a single random IP address.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — Randomly generated IP Address.


💡 Example

randomIP = get_random_ip
print(randomIP) // Output: ###.###.###.###

is_null

📝 Description

Return true if item is null, false otherwise.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
testObject any The item to check

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

booleantrue if null, otherwise false.


💡 Example

nullItem = null
notNull = "A string"

print is_null(nullItem)  // Output: 1
print is_null(notNull)   // Output: 0

is_typeof

📝 Description

Check if the object passed is of the specified type and return a boolean answer.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
testObject any The object to test
objectType string The expected identifier

🚫 Defaults

Parameter Default Value
colorValue (None)

🔁 Return

booleantrue if the object is of the specified type, otherwise false.


💡 Example

print is_typeof(cryptoLibObject, "cryptoLib")       // Output: true
print is_typeof(metaxploitLibObject, "MetaxploitLib") // Output: true
print is_typeof(metaxploitLibObject, "cryptoLib")     // Output: false

🔗 Links


load_lib

📝 Description

Loads a library from the lib directory, optionally specifying directory and verifying type.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
libName string The file name of the library to load (must include extension).
libDir string (optional) Directory where the library is located (should not have trailing slash).
libType string (optional) Expected type of the library (case sensitive).

⚙️ Defaults

Parameter Default Details
libName "metaxploit.so" libName must be full filename including extension
libDir "/lib" libDir should not have trailing slash
libType "" libType is case sensitive

🔁 Return

objectLibrary | null — Returns the loaded library object or null if not found or type mismatched.


💡 Examples

// Loads "metaxploit.so" from "/lib" directory
lib = load_lib  
// Loads a library without specifying type
lib = load_lib("metaxploit.so")  
// Loads a library from specified directory
lib = load_lib("customLib.so", "/altLib")  
// Loads a library with specified type (returns null on type mismatch)
lib = load_lib("crypto.so", "/lib", "cryptoLib")  

network_device_list

📝 Description

Pulls network device data from the host computer and returns a list of network device information. Each item is a list representing a network adaptor, its model, and monitoring status.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
user string (Optional) Username for access.
pass string (Optional) Password for access.

⚙️ Defaults

Parameter Default
user ""
pass ""

🔁 Return

list<list<string>> — A list of network device entries.
Each sublist contains:

[ adapter, model, monitor_enabled ]

💡 Example

netList = network_device_list()
for net in netList
    print(net[0] + " - " + net[1] + " [" + net[2] + "]")


parse_inbox

📝 Description

Parses a list of mail IDs using a global metaMail object and extracts structured message data.
Each parsed message includes: id, from, subject, body.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
mailIDList list A list of message IDs to parse.

➖ Defaults

Parameter Default Value
(None) (None)

🔁 Return

list<object> — A list of parsed mail objects with the following structure:

  • id: Message ID
  • from: Sender
  • subject: Subject line
  • body: Full body text of the email

💡 Example

mailIDs = ["msgid-001", "msgid-002"]
parsed = parse_inbox(mailIDs)
print(parsed[0].subject)  // Output: "Subject line here"

program_name

📝 Description

Return a string with the name of the file that is running this script.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

string — The name of the running program file.


💡 Example

programName = program_name

unsafe_check_list

📝 Description

Split Unsafe Check Results into individual exploit result strings and return a list of UnsafeCheck strings.

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

🧮 Parameters

Name Type Description
scanResults string Result from fetch_exploit_requirements() function.

➖ Defaults

Parameter Default Value
(None) (None)

🔁 Return

list<string> — List of individual unsafe check strings.


💡 Example

libLocation = "/lib/aptclient.so"
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load(locals.libLocation)
exploitMem = find_exploitable_addresses(libLocation, metaxploitObject)
unsafeCheckList = unsafe_check_list(fetch_exploit_requirements(exploitMem))

📄 Construct Overview

report_string_construct__

📝 Description

Constructs and returns an object containing categorized status strings

📃 About
  • Author: Svarii
  • Version: 0.0.1
  • Unit Testing: ❌ Incomplete

➖ Parameters

Parameter Default Value
(None) (None)

🔁 Return

object — An object (gstexts) containing categorized status messages grouped by fail, pass, action, info, and email categories.


📝 Structure Overview

Category Description
fail Contains failure status messages
pass Contains success status messages
action Contains messages indicating ongoing checks
info Contains informational messages
email Contains email-related messages

💡 Examples

statusMessage = report_string_construct__()
print(statusMessage.pass.lib_found)
// Output: "Library found"
statusMessage = report_string_construct__()
print(statusMessage.action.check_user_email)
// Output: "Checking for email account..."

Clone this wiki locally