memo.tcl - wilkowy/eggdrop-scripts GitHub Wiki

memo.tcl v1.3 (2021-03-28)

Build a key-value associative database for your channel.

Script requires wilk.tcl to be present in the same directory.

Channel commands:

Everyone:

  • !memo - use !memo word to query database

Editors:

  • !memo - use !memo word description to add/update database entry

    Additional info:

    • keys are case insensitive
    • description can contain placeholders: #NICK#, #IDENT#, #HOST#, #HAND#, #CHAN#, #KEY#, #QUERY#
    • one memo can directly lead to another (an alias), the syntax is: {other_key}
    • description can have multiple substitutions in format: text {key} text
  • !memo+ - append text to description

  • !memo- - delete entry

  • !memo= - use !memo= old_word new_word to rename entry

  • !memo0 - query for raw description (no substitutions made)

  • !memo? - search database keys for given word

  • !memo?? - search database descriptions for given word

Private commands:

Same as above, but without !.

Partyline commands:

  • .memo query - display memo (without substitutions)
  • .memo search - search all keys/descriptions matching given pattern
  • .memo add - add/modify memo
  • .memo delete - delete memo
  • .memo rename - rename key
  • .memo deref - find descriptions mentioning given key and return list of their keys
  • .memo list - list all memos and dump them to file
  • .memo validate - check database for referencing errors
  • .memo stats - database entries and memory usage
  • .memo save - save database to file (not really needed, done automatically)
  • .memo reload - reload database from file (if edited externally)

Custom flags:

  • memo - channel command is only active on channels with this flag (enable: .chanset #channel +memo, disable: .chanset #channel -memo)

Settings:

  • allowed_users - limits channel command usage to people with such flags (default: "-|-" - public)
  • allowed_prvusers - limits privmsg command usage to people with such flags (default: "n|n")
  • editor_users - users having such flags are recognized as editors (default: "n|n")
  • ignored_users - users with such flags cannot invoke channel commands (default: "I|I", off: "")
  • cmd_prefix - prefix for channel commands (default: "!")
  • cmd_name_query - command name to query/modify database (default: "memo")
  • cmd_name_append - command name to append text to memos (default: "memo+")
  • cmd_name_delete - (default: "memo-")
  • cmd_name_rename - (default: "memo=")
  • cmd_name_raw - (default: "memo0")
  • cmd_name_search - (default: "memo?")
  • cmd_name_vsearch - (default: "memo??")
  • max_matches - max number of returned matches (default: 10)
  • antiflood_delay - prevents channel command abuse, in seconds (default: 2, off: 0)
  • max_redirections - maximum redirections in loop (default: 10)
  • max_substitutions - maximum substitutions in loop (default: 30)
  • memo_file - path and file name of database (default: "scripts/memo.db")
  • memo_dump - path and file name for database dump (.memo list) (default: "scripts/memo.txt")