Skip to content

Instantly share code, notes, and snippets.

@NPException
Last active August 1, 2017 08:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NPException/594621201cf104cdcd9a to your computer and use it in GitHub Desktop.
Save NPException/594621201cf104cdcd9a to your computer and use it in GitHub Desktop.
Shocky cheatsheet

Shocky cheatsheet

This is a collection of placeholders to use within factoids for the bot Shocky on EsperNet IRC. They were collected by manually checking this list for used placeholders and testing them on EsperNet.

Factoid placeholders

Placeholder Description
%arg{idx}[-[to_idx]] examples: %arg0%, %arg1-3%, %arg4-% - prints out the provided argument with index idx. A range of arguments to be printed can also be given by appending a "-" to the index. If no to_idx is provided, all following arguments will be printed out.
%bot% the name of the bot
%chan% current channel
%inp% the whole input of the command
%rndn% random name of a user in the channel
%user% command executor
<lua> will treat the command as Lua code. "arg" is a table with all arguments passed to the command, and "factoid" is a table with all other factoids. You can execute other factoids by calling factoid["name_of_factoid"](). "sender" is a variable containing the name of the command executor.

Lua specific

Variable Content
arg A table with all arguments passed to the command
factoid A table containing other available factoids.The table can be used like this:
  • Grab the Random user name factoid
    local rndnFactoid = factoid["rndn"]
  • Execute the factoid
    local randomName = rndnFactoid()
channel The channel as userdata.
channel.name The name of the current channel.
channel.topic The topic of the current channel.
channel.users A table the users connected to the channel.
sender The name of the command executor.
Function Result
channel.isop( username ) True; if they have op.
channel.isvoiced( username ) True; if they have voice.
@Jezza
Copy link

Jezza commented Jul 28, 2015

Lua specific crap.

Variable Result
sender The name of the command executor.
channel.name The name of the current channel.
channel.topic The topic of the current channel.
Table or userdata Result
channel The channel as userdata.
channel.users A table the users connected to the channel.
factoid A table of all factoids. (factoid["nameOfFactoid"]() or factoid.nameOfFactoid())
arg Table of all passed parameters.
Function Result
channel.isop(username) True; if they have op.
channel.isvoiced(username) True; if they have voice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment