Powerful software for playing games through text, supporting remote connectivity through services such as Twitch.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 KiB

This page documents many common commands for TRBot. You will often use these commands either while playing on or managing a TRBot instance. To learn how to add your own custom commands, see the custom commands page.

Database Fields

In the database, each command in the CommandData table has the following fields:

  • ID - The ID of the command in the database. This is automatically determined, thus it's not recommended to set or modify it.
  • Name - The name of the command. This name is what you type into chat to invoke it (Ex. "tutorial").
  • ClassName - The name of the internal class, with namespace, containing the code this command runs when invoked (Ex. "TRBot.Commands.MessageCommand" for "info").
  • Level - The access level required to invoke the command.
  • Enabled - Determines if the command is enabled and can be invoked (0 = disabled, 1 = enabled).
  • DisplayInList - Determines if the command is displayed in the help for ListCmdsCommand.
  • ValueStr - An additional string value the command may use.

You will need to reload data or restart TRBot to apply any changes in the CommandData table.

Instructional

  • ListCmdsCommand (default: "!help") - Lists all commands available at your access level in alphabetical order. An optional "disabled" or "all" argument will display either only disabled commands or all commands regardless of enabled state, respectively.
  • ListRoutinesCommand (default: "!routines") - Lists all routines available in alphabetical order. An optional "disabled" or "all" argument will display either only disabled routines or all routines regardless of enabled state, respectively.
  • VersionCommand (default: "!version") - Displays the application and data version numbers of the TRBot instance you're interacting with.
  • Default: "!tutorial" (internally a MessageCommand) - Displays the tutorial message, including how to play.
  • Default: "!sourcecode" (internally a MessageCommand) - Displays where to obtain the source code for the TRBot instance you're interacting with.

Management

  • GetDBSettingCommand (default: "!getdbsetting") - Retrieves the current ValueStr or ValueInt of a setting in the Settings table of the database.
    • Example: "!getdbsetting force_init_defaults int"
  • SetDBSettingCommand (default: "!setdbsetting") - Sets the ValueStr or ValueInt of a setting in the Settings table of the database to a given value. If a setting with the given key doesn't exist in the database, it will be added.
    • Example: "!setdbsetting message_prefix string hi"
  • RemoveDBSettingCommand (default: "!removedbsetting") - Removes a setting with the given key in the Settings table of the database.
    • Example: "!removedbsetting my_setting"

Commands

  • AddCmdCommand (default: "!addcmd") - Adds a new command TRBot can recognize. If the command already exists, it'll be updated.
    • Example: "!addcmd testmsg TRBot.Commands.MessageCommand This is a test message User true true"
  • RemoveCmdCommand (default: "!removecmd") - Removes a command from TRBot.
    • Example: "!removecmd testmsg"
  • ToggleCmdCommand (default: "!togglecmd") - Enables or disables a specific command from TRBot.
    • Example: "!togglecmd testmsg true"
    • Example: "!togglecmd tutorial false"

Routines

  • AddRoutineCommand (default: "!addroutine") - Adds a new routine for TRBot to run in the update interval. If the routine already exists, it'll be updated.
    • Example: "!addroutine periodicmessage TRBot.Routines.PeriodicMessageRoutine null true true"
  • RemoveRoutineCommand (default: "!removeroutine") - Removes a routine from TRBot.
    • Example: "!removeroutine periodicmessage"
  • ToggleRoutineCommand (default: "!toggleroutine") - Enables or disables a specific routine from TRBot.
    • Example: "!toggleroutine reconnect true"
    • Example: "!toggleroutine creditsgive false"

Moderation

  • AddRestrictedInputCommand (default: "!restrictinput") - Restricts a user from performing a given input on a given game console for a given period of time. "null" indicates an indefinite restriction.
    • Example: "!restrictinput user1 nes a 30m" - user1 is restricted from pressing the "a" button for NES games for 30 minutes.
    • Example: "!restrictinput user2 gc l null" - user2 is restricted from pressng the "l" button and axis for GameCube games indefinitely.
  • RemoveRestrictedInputCommand (default: "!unrestrictinput") - Removes a restricted input on a user for a given game console.
    • Example: "!unrestrictinput user1 nes a"
  • ListRestrictedInputsCommand (default: "!listresinputs") - Lists all restricted inputs on a given user.
    • Example: "!listresinputs user1"
  • GlobalInputPermissionsCommand (default: "!inputperms") - Obtains the global minimum access level required to perform inputs, or sets it if you have sufficient privileges and provide an argument. Only users at or above this level can perform inputs.
    • Example: "!inputperms"
    • Example: "!inputperms Admin" - Allows users only with Admin-level access and up to perform inputs.
  • SetUserLevelCommand (default: "!setlevel") - Sets a user's access level if you have sufficient privileges. You cannot set a user's access level to a value equal to or above your own.
    • Example: "!setlevel user1 VIP"
  • UpdateUserAbilityCommand (default: "!toggleability") - Adds or updates a user ability on a given user for a given period of time. "null" indicates the ability is enabled or disabled for an indefinite time. This can be used to silence misbehaving users or give temporary access to a trusted individual to help moderate while you're away.
    • Example: "!toggleability user1 silenced true null 0 30d" - Silences user1 for 30 days, disallowing them from making inputs during this time.
    • Example: "!toggleability user2 duel false null 0 null" - Disables user2 from being able to duel others indefinitely.
  • ListUserAbilitiesCommand (default: "!userabilities") - Lists all user abilities on a given user, including their enabled state and the expiration date, if any.
    • Example: "!userabilities user1"
  • ListPermissionAbilitiesCommand (default: "!allabilities") - Lists all available permission abilities in the database. These are all the abilities that can be enabled or disabled on a given user.
  • GetSetUserAbilityLvlOverrideCommand (default: "!userabilitylvloverride") - Displays the level override of a specific ability on a given user, or sets it if you supply an argument and have a level greater than or equal to the current level override. A value of -1 will disable the level override.
    • Example: "!userabilitylvloverride user1 silenced"
    • Example: "!userabilitylvloverride user1 silenced -1" - Sets the level override of the "silenced" ability on user1 to -1, disabling it.
  • SilenceUserCommand (default: "!silence") - Silences a given user, preventing them from making inputs. This is a convenience command that adds the silenced ability to the user.
    • Example: "!silence user1"
  • UnsilenceUserCommand (default: "!unsilence") - Unsilences a given user, allowing them to make inputs again. This is a convenience command that removes the silenced ability from the user.
    • Example: "!unsilence user1"
  • ListSilencedUsersCommand (default: "!listsilenced") - Lists all silenced users in the database.
  • StopAllInputsCommand (default: "!stopall") - Stops all ongoing inputs on all virtual controllers. While inputs are being stopped, new inputs will not be processed. Most machines will often stop all inputs and re-enable them within 50 milliseconds or less (likely less). This command is very useful to stop long or repetitive input sequences instead of waiting for them to finish.
  • AddConsoleCommand (default: "!addconsole") - Adds a new game console to the database. The new console will not have any inputs, so you will need to add some afterwards for it to be useful.
    • Example: "!addconsole turbografx"
  • RemoveConsoleCommand (default: "!removeconsole") - Removes a game console from the database.
    • Example: "!removeconsole turbografx"
  • GetSetConsoleCommand (default: "!console") - Obtains the current game console in use, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!console"
    • Example: "!console ps4" - Sets the current console to ps4.
  • AddInputCommand (default: "!addinput") - Adds a new input to a given game console with a name, button value, axis value, input type, and min/max axis range. If the input already exists, it'll be updated with the new information.
    • Example: "!addinput nes spareinput1 8 0 1 0 0 100"
    • Example: "!addinput genesis blankinput 0 0 0 0 0 0"
    • Example: "!addinput gc l 5 0 3 0 1 99" - This is how to add the "L" button on the Nintendo GameCube controller, which acts as an axis until it is 100% pressed in, in which it is a button. The last value indicates the max range (0 - 100) the axis can be pressed before it's considered a button.
  • RemoveInputCommand (default: "!removeinput") - Removes an input from a given game console.
    • Example: "!removeinput nes spareinput1"
  • SetInputLevelCommand (default: "!setinputlevel") - Sets the access level for a specific input on a given game console.
    • Example: "!setinputlevel gba r Moderator"
  • SetInputEnabledCommand (default: "!toggleinput") - Enables or disables a specific input on a given game console.
    • Example: "!toggleinput gba b false"
    • Example: "!toggleinput wii c true"
  • InputInfoCommand (default: "!inputs") - Displays all available inputs for a given game console, or displays information about a specific input on a given game console.
    • Example: "!inputs" - Displays all inputs for the current console.
    • Example: "!inputs ps2" - Displays all inputs for the ps2 console.
    • Example: "!inputs snes y" - Displays detailed input data for the snes console's "y" input.
  • AddInputSynonymCommand (default: "!addsyn") - Adds an input synonym to a given input on a given game console. If the input synonym already exists, it'll be updated.
    • Example: "!addsyn n64 . #" - This causes all instances of "." in the input sequence to be replaced with "#".
  • RemoveInputSynonymCommand (default: "!removesyn") - Removes an input synonym from a given input on a given game console.
    • Example: "!removesyn n64 ."
  • ListInputSynonymsCommand (default: "!listsyn") - Lists all available input synonyms for a given game console.
    • Example: "!listsyn ps2"
  • AddMacroCommand (default: "!addmacro") - Adds an input macro for the given input sequence. If the macro already exists, it'll be updated. Input macros must begin with "#".
    • Example: "!addmacro #slide _down34ms a -down34ms"
    • Example: "!addmacro #mash(*) [<0>34ms #34ms]*20"
  • RemoveMacroCommand (default: "!removemacro") - Removes an input macro.
    • Example: "!removemacro #slide"
  • ShowMacroCommand (default: "!showmacro") - Shows the input sequence for a given input macro.
    • Example: "!showmacro #slide"
    • Example: "!showmacro #mash(*)"
  • ListMacrosCommand (default: "!macros") - Lists all available input macros.
  • DefaultInputDurCommand (default: "!defaultinputdur") - Obtains the global default input duration, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!defaultinputdur"
    • Example: "!defaultinputdur 500" - Sets the global default input duration to 500 milliseconds.
  • MaxInputDurCommand (default: "!maxinputdur") - Obtains the global max input duration, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!maxinputdur"
    • Example: "!maxinputdur 120000" - Sets the global max input duration to 2 minutes.
  • MidInputDelayCommand (default: "!midinputdelay") - Obtains the global mid input delay enabled state and duration, or sets them if you have sufficient privileges and provide arguments.
    • Example: "!midinputdelay"
    • Example: "!midinputdelay true" - Enables the global mid input delay.
    • Example: "!midinputdelay 500" - Sets the global mid input delay duration to 500 milliseconds.
    • Example: "!midinputdelay false 300" - Disables the global mid input delay and sets its duration to 300 milliseconds.
  • ControllerPortCommand (default: "!port") - Obtains or sets your controller port. Controller ports start at 1 and cannot exceed the number of controllers plugged in.
    • Example: "!port"
    • Example: "!port 2"
  • ControllerCountCommand (default: "!controllercount") - Obtains the number of controllers plugged into the current virtual controller, or sets the count if you have sufficient privileges and provide an argument. Changing the controller count will stop all ongoing inputs and reinitialize all controllers.
  • ListPressedInputsCommand (default: "!pressedinputs") - Lists all inputs currently pressed on a given virtual controller. By default, this uses your own controller port, but you can supply another port as an argument.
    • Example: "!pressedinputs 1" - Lists all pressed inputs on controller port 1.
    • Example: "!pressedinputs 2" - Lists all pressed inputs on controller port 2.
  • GetSetTeamsModeCommand (default: "!teamsmode") - Obtains the enabled state of teams mode, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!teamsmode true" - Enables teams mode, causing new users to be assigned a different controller port based on teams mode settings.
    • Example: "!teamsmode false" - Disables teams mode, causing new users to be assigned to controller port 1 (value 0).
  • GetSetTeamsModeMaxPortCommand (default: "!teamsmaxport") - Obtains the zero-based maximum controller port for teams mode, or sets it if you have sufficient privileges and provide an argument. It's recommended to set this below the virtual controller count, otherwise users assigned controller ports equal to or higher than it will need to manually lower their ports to play.
    • Example: "!teamsmaxport 1" - Sets the max controller port to 2, so each new user will alternate between controller ports 1 and 2.
    • Example: "!teamsmaxport 2" - Sets the max controller port to 3, causing each new user to be assigned either port 1, 2, or 3 based on the current rotating value.
  • AddInvalidInputComboCommand (default: "!addinvalidcombo") - Adds an input to the invalid input combo for a given console. The input given must be a valid input on the console. Invalid input combos prevent the entire combination of inputs from being pressed at once on the same controller port.
    • Example: "!addinvalidcombo nes select" - Adds the "select" button to the invalid input combination for the NES console.
  • RemoveInvalidInputComboCommand (default: "!removeinvalidcombo") - Removes an input from the invalid input combo for a given console.
    • Example: "!removeinvalidcombo nes select" - Removes the "select" button from the invalid input combo for the NES console.
  • ListInvalidInputComboCommand (default: "!invalidcombo") - Lists the invalid input combo for a given console.
    • Example: "!invalidcombo genesis" - Lists the invalid input combo for the Sega Genesis.
  • TogglePeriodicInputCommand (default: "!periodicinput") - Obtains the enabled state of the periodic input, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!periodicinput true"
  • GetSetPeriodicInputPortCommand (default: "!periodicinputport") - Obtains the non-zero-based default controller port for the periodic input, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!periodicinputport 1"
  • GetSetPeriodicInputTimeCommand (default: "!periodicinputtime") - Obtains the interval, in milliseconds, for performing the periodic input, or sets it if you have sufficient privileges and provide an argument. It's highly recommended to keep this value on the higher end, as lower values can drastically interfere with player inputs and spam chat.
    • Example: "!periodicinputtime 30000" - Sets the periodic input to be performed every 30 seconds.
  • GetSetPeriodicInputSequenceCommand (default: "!periodicinputseq") - Obtains the input sequence the periodic input performs, or sets it if you have sufficient privileges and provide an input sequence as an argument. The input sequence must be one that you can normally perform, and it will perform some validation to ensure this. The validation includes includes comparing the user's level to the global input permission level and the permission level of each input in the input sequence, checking the user's restricted inputs, and verifying the controller port for each input. Invalid input combos are not checked at this time but rather when the input sequence is actually performed.
    • Example: "!periodicinputseq a+b #1s _left #300ms a1s &2b500ms"
  • TogglePeriodicInputMessageCommand (default: "!periodicinputmsg") - Obtains the enabled state of the periodic input message, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!periodicinputmsg true"
  • ListUserRecentInputsCommand (default: "!recentinput") - Views a user's most recent input sequence at a given position, with higher values being older. You can supply an argument for which user to view recent inputs for. If the user being checked is currently opted out of bot stats, it will not display their recent inputs.
    • Example: "!recentinput 1" - Displays the most recent input for yourself.
    • Example: "!recentinput user1 3" - Displays the 3rd most recent input for user1.
  • GetSetMaxUserRecentInputsCommand (default: "!recentinputcount") - Obtains the max number of recent input sequences stored per user, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!recentinputcount" - Displays the max number of recent input sequences stored per user.
    • Example: "!recentinputcount 3" - Sets the max number of recent input sequences stored per user to 3.
  • GetSetInputModeCommand (default: "!inputmode") - Obtains the input mode, or sets it if you have sufficient privileges and provide an argument. The two available modes are Anarchy (default) and Democracy. See the input_mode setting for more information on these options.
    • Example: "!inputmode Anarchy" - Sets the input mode to Anarchy.
    • Example: "!inputmode Democracy" - Sets the input mode to Democracy.
  • GetSetDemocracyResModeCommand (default: "!dresmode") - Obtains the resolution mode for the Democracy input mode, or sets it if you have sufficient privileges and provide an argument. See the democracy_resolution_mode setting for more information about the available options.
    • Example: "!dresmode exactsequence" - Sets the resolution mode to ExactSequence.
  • GetSetDemocracyVoteTimeCommand (default: "!dvotetime") - Obtains the voting time for the Democracy input mode, in milliseconds, or sets it if you have sufficient privileges and provide an argument. It's recommended to keep this value in the 1000 to 120000 range, as values too high can significantly slow down gameplay.
    • Example: "!dvotetime 5000" - Sets the voting time to 5 seconds.
  • VoteForInputModeCommand (default: "!vote") - Votes for a given input mode if you have sufficient privileges, or retrieves the current number of votes for each input mode if a vote has begun. If no vote is in progress, a new vote will be started. Once the vote is concluded, the input mode with the most votes will be set as the new one, and voting will be on cooldown, determined by the value of the input_mode_change_cooldown setting.
    • Example: "!vote Anarchy" - Places a vote for the Anarchy input mode.
    • Example: "!vote Democracy" - Places a vote for the Democracy input mode.
  • GetSetInputModeVoteTimeCommand (default: "!votetime") - Obtains the duration of the voting period for changing the input mode, in milliseconds, or sets it if you have sufficient privileges and provide an argument.
    • Example: "!votetime 50000" - Sets the input mode voting time to 50 seconds.
  • GetSetInputModeCooldownCommand (default: "!votecooldown") - Obtains the duration of the voting cooldown after a new input mode was voted on. Once the cooldown expires, a new vote to change the input mode can begin. It's recommended to have this value at least at 10 minutes so players can focus more on playing than voting, but your stream may vary. The input_mode_next_vote_date setting is assigned to the current time plus this value after voting is completed.
    • Example: "!votecooldown 2400000" - Sets the voting cooldown to 40 minutes.

Game Progress/Logging

  • AddGameLogCommand (default: "!addlog") - Adds a time-stamped game log to the database. This log is used to indicate others of game progress.
    • Example: "!addlog Beat King Bob-Omb! Currently at 8 Power Stars!"
  • ViewGameLogCommand (default: "!viewlog") - Views a game log. You can supply an argument for how many game logs back to check, with higher values being older. If the user who created this game log is currently opted into bot stats, it will also display their so other users can ask them for more details about the game log.
    • Example: "!viewlog" - Displays the most recent game log.
    • Example: "!viewlog 5" - Displays the fifth most recent game log.
  • ViewMultipleGameLogsCommand (default: "!viewmultilogs") - Views a number of game logs starting from the most recent. You can supply an argument for how many game logs to view. There is a short delay between printing each game log. To avoid spamming chat, this command will reject subsequent uses that attempt to view more game logs while it's already printing them. You can cancel it printing game logs by providing a special argument.
    • Example: "!viewmultilogs 5" - Displays the 5 most recent game logs.
    • Example: "!viewmultilogs cancel" - Cancels viewing game logs.
  • SaveTextToFileCommand - Saves the arguments as text into a given file, determined by the ValueStr of the command in the database. The ValueStr can be a database setting or absolute file path. The text in this file can then be displayed on stream if the streamer provided it.
  • SetGameMessageCommand (default: "!setmessage") - Sets a game message that can be displayed on stream if the streamer provided it. This is useful for informing others of the current objective in a game. Internally, this is a pre-configured SaveTextToFileCommand.
    • Example: "!setmessage Beat Phantom Ganon"

Games/Fun

  • AddMemeCommand (default: "!addmeme") - Adds a meme to the database. If the meme already exists, it'll be updated. Enclose multi-word meme names in quotes.
    • Example: "!addmeme lol Kappa"
    • Example: "!addmeme "this is a test" yup it is"
  • RemoveMemeCommand (default: "!removememe") - Removes a meme from the database. Remove multi-word memes by specifying the entire phrase without quotes.
    • Example: "!removememe lol"
    • Example: "!removememe this is a test"
  • ListMemesCommand (default: "!memes") - Lists all memes.
  • CreditsCommand (default: "!credits") - Lists the number of credits you have, or optionally the number of credits another user has.
    • Example: "!credits"
    • Example: "!credits user1"
  • BetCreditsCommand (default: "!bet") - Bets credits for a chance to win double your bet.
    • Example: "!bet 500"
  • DuelCommand (default: "!duel") - Challenges another user to a duel for credits, or accepts/denies a duel if you've been challenged.
    • Example: "!duel user1 500"
    • Example: "!duel accept"
    • Example: "!duel deny"
  • EnterGroupBetCommand (default: "!groupbet") - Enters the group bet with a given bet. If you're already in the group bet, this will adjust your bet to the new value. If you entered the group bet and there are now enough participants, the group bet will begin.
    • Example: "!groupbet 500
  • LeaveGroupBetCommand (default: "!exitgroupbet") - Leaves the group bet. If there are no longer enough participants for the group bet after leaving, the group bet will be cancelled.
  • IgnoreMemesCommand (default: "!ignorememes") - Obtains your status for ignoring memes or sets it if an argument is provided. While ignoring memes, any phrases you say in chat will no longer trigger a message from the bot. For example, "hi" may be a meme that causes the bot to reply with "hello" when received in chat. Ignoring memes would cause no response from the bot.
    • Example: "!ignorememes true"
  • UserSimulateCommand (default: "!simulate") - Simulates a given user, including themselves, by generating random phrases using messages the user entered, provided the one using the command has sufficient privileges. This only works for users opted into both bot stats and simulate data. Each simulation costs credits based on the defined simulate credit cost.
    • Example: "!simulate"
    • Example: "!simulate user1"
  • UserSimulateManageCommand (default: "!simulatemng") - Helps manage a user's simulate data. This encompasses opting in and out of simulate data and clearing simulate data. Only users opted into bot stats can manage their simulate data. Without any arguments, this displays information about the user's simulation data.
    • Example: "!simulatemng" - Displays simulation opt-in status and simulation data length.
    • Example: "!simulatemng true" - Opts into simulation data.
    • Example: "!simulatemng clear" - Clears simulation data.