User Tools

Site Tools


melanobot:running

Running the bot

Command line

Synopsis

melanobot [--config=file] [--config.key=value…] [--settings.key=value…]

melanobot --help

Options

  • --help – Shows help and exits
  • --config=file – Selects a configuration file
  • --config.key=value – Where config.key is a key in the config file, it overwrites that key with value
  • --settings.key=value – Sets a globally accessible setting with name key and value value

melanobot.sh

The script melanobot.sh can be used to simplify the execution of the bot.

Synopsis

melanobot.sh [variable=value…] command [option…]

Commands

run

Synopsis: run [args…]

Starts the bot and runs it (blocking action). It sets up a named pipe to allow termination from the script. To work properly it needs to have the Pipe template set up as in the examples. args are forwarded to the bot process.

This allows the bot to be restart itself.

start

Synopsis: start [loop] [args…]

If the first argument is loop, it calls the command loop. Calls run in a tmux window (requires tmux to be installed on the system). args are forwarded to the bot process.

stop

Stop an instance started with start or run.

restart

Calls stop and start.

update

Calls build and restart.

cleanup

Removes temporary files created by run.

loop

Causes the bot (when executed from run) to restart when the bot process ends.

noloop

Causes the bot (when executed from run) to stop when the bot process ends.

configure

Synopsis: configure [args…]

Configures the build directory. args are forwarded to cmake.

build

Synopsis: build [args…]

Compiles the bot. args are forwarded to make.

attach

Attaches to the tmux window created by start.

help

Shows help.

Variables

Name Default Description
RUN_DIR $PWD Directory to run the bot on
SRC_DIR (script directory) Directory with the bot sources
BUILD_DIR $SRC_DIR/build Directory to complile in
BIN_DIR $BUILD_DIR/bin Directory containing the bot executable
EXECUTABLE melanobot Name of the bot executable (relative to $BIN_DIR)
TMP_DIR /tmp/.melanobot Directory for temporary files created by the script
BOT_ID $USER Bot instance ID
TMUX_SESSION bot Name of the tmux session
melanobot/running.txt · Last modified: 2015/06/07 14:25 by melanosuchus