# The Mana World Watcher config file # zshcompdesc: script -> show db entries, client statistics and online activity checks for CHARNAME # zshcompoverride: inspect INCLUDE default.conf DRYRUN yes actions { script inspect } inspect { eval set -- "$prefixed_params" : ${1?"usage: [ -h ] [ -c ] $0 \"Character name\""} opt_finish=''; opt_client='' while $GETOPTS 'hc' opt ; do case "$opt" in h) cat << EOF $0 -- inspect char; wrapper above tmww util for TMW MMORPG usage: [ -h ] [ -c ] $0 "Character name" -h -- show help -c -- add client versions summary to output default behavior: all commands will use dbplayer alias if available (with all known alts included in result queries) or will try chars on same account; monthly and average report results for last two monthes EOF opt_finish="true" ;; c) opt_client="true" ;; *) echo >&2 "Unknown option. Aborting."; opt_finish="true" ;; esac done [ -n "${opt_finish}" ] && continue shift $(expr $OPTIND - 1) [ -z "$1" -o -n "$2" ] && { echo >&2 "Incorrect command line: $* . Aborting."; continue; } requireplugin alts.plugin charalias=$( func_player_get "$1" ); if [ -n "${charalias}" ]; then func_arseoscope "$1" [ -n "${opt_client}" ] && runaction client summary -p "${charalias}" runaction activity daily -rsp "${charalias}" runaction activity monthly -rsp "${charalias}" runaction activity average -rsp "${charalias}" else charid=$( func_char_get "$1"); if [ -n "${charid}" ]; then func_arseoscope "$1" [ -n "${opt_client}" ] && runaction client summary -a "${charid}" runaction activity daily -rsa "${charid}" runaction activity monthly -rsa "${charid}" runaction activity average -rsa "${charid}" else printf 'Character "%s" has no DB entries.'"\n" "$1" [ -n "${opt_client}" ] && runaction client summary -c "$1" runaction activity daily -rsc "$1" runaction activity monthly -rsc "$1" runaction activity average -rsc "$1" fi fi }