[archived content]

Commands !set, !reset and !say support "replacements", or special forms of text replaced with other text.

The syntax is generally %<something>%, such as the following:

I %verb% all the time.

and the %verb% is replaced with a verb; for example:

I estimate all the time.


Here are some of the built in replacement identifiers:

  • nick - nickname of the person who triggered the replacement
  • chan - current IRC channel/room name
  • bot - bot's nickname
  • arg - optional argument (first) supplied when retrieving word
  • arg! - required argument (first)
  • args - optional arguments (all)
  • args! - required arguments (all)
  • argN - Nth argument (offset)
  • argornick - uses the argument (first) if supplied, or falls back to their nickname
  • lastmsg - last message to the channel (excluding bot's)
  • lastmsgnick - last speaker's nickname (excluding bot)

Ones giving random results (sometimes called reversed madlibs):

  • verb - verbs
  • noun - nouns
  • thing - subset of nouns which are things
  • adv - adverbs
  • adj - adjectives
  • feel - feelings/moods
  • color - color names
  • food - types of food
  • drink - types of drink
  • clothing - types of clothing
  • place - places/locations
  • animal - types of animals
  • job - job titles
  • shape - shapes
  • drug - types of drugs
  • letter - random letter
  • digit - random digit
  • num - random number between 0 and 100
  • smiley - random smiley
  • truefalse - randomly true or false
  • yesno - randomly yes or no
  • vehicle - types of vehicles
  • body - body parts
  • randN - random number with upper bound N
  • randM-N - random number with lower bound M and upper bound N
  • ?@word - retrieve a set word; see below for details

User Identifiers

If you !set or !reset a word starting with @ (the at symbol), you can use it as a replacement. For example:

!set @fun this is fun
!say The answer is: %?@fun%!

The output would be:

The answer is: this is fun!

Randomized Lists

You can make your own randomized lists like the above built in identifiers. Simply separate items with | (the or symbol), like the following:

!say Pick one: %foo|bar|baz%

Would output something similar to:

Pick one: bar

The default action is not to evaluate items in randomized lists, but you can force evaluation by enclosing the item with curly braces, like so:

!say Is your name %cookie monster|{nick}%?

which literally uses cookie monster or evaluates nick to your current nickname. User variables are also evaluated and do not need curly braces; user variables explained below.

User Variables

User variables may be saved temporarily and expire over time. To set a variable, enclose a name in square brackets after the replacement identifier:

!say Look at the %thing[mything]%

This implicitly sets a variable named [mything] to the word thing returned.

To recall a variable, simply use %[variablename]%

Variables can be relative to the person requesting the replacement; this is accomplished by prepending the variable name with ~ (tilde), such as %thing[~mine]%
There's also channel-relative variables if the name is prefixed with #

User variables are saved between requests, but expire unpredictably. However, you can generally assume the variable will exist within a couple minutes.

Variables can be local to the current script by prefixing with a dot. These variables are essentially unset automatically.


There are special flags that can be used to affect the output of a replacement. To specify a flag, put a colon and flag characters after the identifier (but before setting a variable). The flag characters, or flags, are listed below.

  • c - capitalize; makes the first letter uppercase
  • C - capwords; uppercases the first letter of every word
  • u - make the whole thing uppercase
  • l (L) - make the whole thing lowercase
  • s - remove all spaces
  • S - remove leading and trailing spaces
  • h - HTTP URL encode
  • H - HTTP URL decode
  • x - exclude this replacement from being output; useful for setting variables
  • 1 (one) - try to make this replacement unique; useful for randomized identifiers
  • i - turn into a safe C identifier; use with s to use underscores
  • p - plain, do not evaluate identifiers
  • b - only output the first word (beginning)
  • e - only output the last word (ending)
  • B - only output the first character
  • E - only output the last character
  • = - conditional; compare first 2 items in a list, return 3rd if matching, or 4th (optional) otherwise
  • #N - where N is: 0 to get the string's length; or an integer to get the Nth character; BbEe? affect this
  • + - add one to the number; multiple + adds more
  • - - subtract one from the number; multiple - subtracts more

For example:

!say %verb:u%!

may output:


Example conditional:

!say %Joe|{nick}|Hi, Joe!|Sorry, I don't know who you are:=%

Compares the literal text Joe with the identifier nick (current nickname). If the person's nickname is Joe, it greets him, or tells the person I don't know you.

Arbitrary Aliasing

You can arbitrarily redirect to other sets with !set and !reset. If the first word of the set is -A (dash and uppercase A; the uppercase is important), the user will automatically be redirected to another set identified by the word after the -A, which can be calculated using replacements. For example:

!set GotoMe -A %nick%

This will take the user to ?theirnick when they type ?GotoMe This can also be used to pass arguments, which can also evaluated with replacements.

As well as -A, there is +A which will append words to the alias.

!set nextone +A one after

will add " after" to the "one" word. Note that this adds a space.
Also, +AA, instead of appending words, appends literal text, without a space.

There is also -D defaultword testword where the defaultword is a default fallback word if testword doesn't exist. If testword does exist, it goes to it, otherwise it goes to the defaultword. When defaultword is chosen, %notset% is the testword that failed.

Page last modified on February 21, 2008, at 05:19 PM