Macro/Keybind Mod script editor
new-script
Documentation
  • Actions
  • Variables
  • Parameters
  • REPL Commands
  • Iterators
  • Events
  • Code Samples
  • Editor Features
  • Other
Random Challenge
Usage
Randomly selected
ARRAYSIZE(<array[]>,[#outvar])
Stores the size of the specified `<array[]>` in `[#outvar]`.

Returns the size of the array.
Example
&array[] = "Hello"
&array[] = "World"

ARRAYSIZE(&array[],#variant1)

&array[] = "Bigger"

#variant2 = ARRAYSIZE(&array[])

// Output 2 and 3 respectively
LOG(%#variant1%)
LOG(%#variant2%)
Editor
Usage
Randomly selected
INDEXOF(<array[]>,<#outvar>,<searchfor>,[casesensitiv])
Gets the first index of `` in `` and stores it in ``.

`[casesensitive]` can be set to `true` which will cause the check to be case-sensitive. (By default the search is case-insensitive.)

Returns the found index.
Example
&array[] = "Looking"
&array[] = "for"
&array[] = "Hello"
&array[] = "World"

INDEXOF(&array[],#variant1,"Hello")
#variant2 = INDEXOF(&array[],,"Not here")

// Output 2 and -1 respectively
LOG(%#variant1%)
LOG(%#variant2%)
Suggestions