Ghost Commands
  • Getting Started
    • Quickstart
    • Syntax
      • Command syntax
      • Arguments with multiple values
    • Custom commands
  • Documentation
    • Commands
      • Static commands
      • Non-static commands
      • Dynamic commands
      • Overloads
      • Parameters
      • Additional attributes
    • Suggestions
      • Suggestion attributes
      • Suggestor methods
    • Converters
      • Custom parameter types
      • Using the ArgumentReader
      • Multiple ways to interpret an argument
    • Processors
      • Creating a processor
      • Setting priorities
      • Cheat codes example
    • Macros
    • Settings
    • Customization
    • Included Commands
Powered by GitBook
On this page
  • Creating macros​
  • Viewing current macros​
  • Removing macros​

Was this helpful?

  1. Documentation

Macros

PreviousCheat codes exampleNextSettings

Last updated 7 months ago

Was this helpful?

A macro acts as shorthand for longer inputs. You could for example shorten a command with multiple parameters, into a concise macro that is faster to write.

Creating macros

Create a macro with the macro.add command, followed by the input you want to substitute. Typing macro.add loadmain 'scene.load MainScene' results in a macro called #loadmain. When the input gets processed, #loadmain will automatically be replaced with scene.load MainScene.

Note

Alternatively, macros can be created by typing #name, followed by the input. For example: #loadmain 'scene.load MainScene'

More macro usages

Let's say we have added a macro with macro.add loadmain 'scene.load MainScene'

When typing '#loadmain'
It replaces your input with 'scene.load MainScene' 

Now let's say we add a macro like this: macro.add emerald (0,208,98)

When typing 'fog.color #emerald'
It replaces your input with 'fog.color (0,208,98)'

Which makes your fog an objectively beautiful emerald green.

Viewing current macros

For an overview of all macros currently registered, simply execute the macro.getall command.

Removing macros

To remove a macro, type macro.remove followed by the name of the macro, excluding the #. macro.remove loadmain You can also remove all registered macros with macro.removeall

​
​
​