# User Command

## Command Types:

Separator
  Adds a separator to the menu
Raw
  Sends raw command to the hub (experts only, end it with '|' in NMDC hubs and '\n' in ADC hubs!)
Chat
  Sends command as if you were typing it in the chat
PM
  Sends command as if you sent it by PM

## Context

Contexts determine where the command is shown.

Hub Menu
  Hub tab (at the top of the screen) right-click menu
User Menu
  User right-click menu in chat and PM tab menu
Search Menu
  Search right-click menu
File list Menu
  File list right-click menu

## Parameters

Name
  Name (use '\' to create submenus)
Command
  Command text (may contain any of the variables listed below). Use Ctrl + Enter to create a new line.
Hub
  Hub ip as typed when connecting (empty = all NMDC hubs, "op" = NMDC hubs where you're an operator, "adc://" = all ADC hubs, "adc://op" = ADC hubs where you're an operator, "adcs://" = all TLS enabled hubs)
To
  Private Message recipient
Send Once Per Nick
  Send only once per user from search frame, regardless of how many files you've selected from that user

## Variables

In the parameters, you can use %[xxx] variables and date/time specifiers (%Y, %m, ...). The following variables are also available:

- %[fileFN]: Filename (search, file list, and transfer view contexts only)
- %[fileSIsize]: File size (search, file list contexts only)
- %[fileSIshort]: File size, short version including units (search, file list contexts only)
- %[fileTR]: TTH for the file, or "NONE" (search, file list contexts only)
- %[type]: "File" or "Directory" (directory context only)
- %[line:reason]: Opens up a window asking for "reason"

In addition to these variables, all of the ADC INF flags are available, with the following prefixes: my, user, and hub. Some may not be available on NMDC hubs. Many useful ones are enumerated below:

- %[myNI]: Your nick
- %[myCID]: Your ADC CID
- %[userNI]: The user's nick
- %[userCID]: The user's ADC CID
- %[userI4]: The user's IP (if supported by hub)
- %[userTAG]: The user's tag
- %[userDE]: The user's description
- %[userEM]: The user's email
- %[userSS]: The user's shared bytes (exact)
- %[userSSshort]: The user's shared bytes (formatted with units)

## Compatibilty Variables

- %[mynick] = %[myNI]
- %[nick] = %[userNI]
- %[file] = %[fileFN]
- %[filesize] = %[fileSI]
- %[filesizeshort] = %[fileSIshort]
- %[tth] = %[fileTR]
- %[mycid] = %[myCID]
- %[cid] = %[userCID]
- %[ip] = %[userI4]
- %[tag] = %[userTAG]
- %[description] = %[userDE]
- %[email] = %[userEM]
- %[share] = %[userSS]
- %[shareshort] = %[userSSshort]