summaryrefslogtreecommitdiff
path: root/tmw-info.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tmw-info.sh')
-rwxr-xr-xtmw-info.sh57
1 files changed, 38 insertions, 19 deletions
diff --git a/tmw-info.sh b/tmw-info.sh
index 712ca93..cf46fc3 100755
--- a/tmw-info.sh
+++ b/tmw-info.sh
@@ -1,9 +1,18 @@
#!/bin/bash
-# TMW GM Log Downloader (original): https://gitlab.com/liviorecchia/tmw-gm-log-downloader
-# tmw-info: https://git.themanaworld.org/legacy/tmw-info/
-# The Mana World: https://themanaworld.org
-# Ledmitz (2020) - GPL 3.0
+function intro_
+{
+ echo "
+Based on TMW GM Log Downloader (original): https://gitlab.com/liviorecchia/tmw-gm-log-downloader
+Copyright © 2020 - Ledmitz
+Copyright © 2022 - Livio Recchia
+
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
+
+The Mana World: https://themanaworld.org
+tmw-info: https://git.themanaworld.org/legacy/tmw-info/"
+}
# Chat logs DIR
CHAT_LOGS="$HOME/.local/share/mana/logs/server.themanaworld.org/"
@@ -35,31 +44,43 @@ trap FINISH EXIT
help(){
- echo "tmw-info [command] [STRING]"
+ echo ""
+ echo "The Mana World Legacy Informations download tool. It doesn't work with other game servers (like TMW2:ML) so far."
+ echo ""
+ echo "Usage: $0 [command] [STRING]"
echo " help / --help / -h (this help screen)"
+ echo ""
echo " cmds-update (downloads command source files. Should be run before using \"cmds\")"
echo " cmds (ManaPlus and GM command reference)"
echo " news (reads game news)"
echo " online (shows online players)"
- echo " gm-update (downloads all GM logs. Should be run before searching)"
- echo " gm-search TERM1 TERM2 TERM3 ... (results contain any of the terms)"
- echo " gm-asearch TERM1 TERM2 TERM3 ... (results contain all of the terms)"
- echo " gm-esearch TERM1 TERM2 TERM3 ... (results contain the exact term)"
- echo " gm-show (if zenity is installed, displays a GUI pop-up of the last 10 issued GM CMDs), otherwise in terminal"
+ echo ""
echo " chat-search TERM1 TERM2 TERM3 ... (chat: results contain all of the terms)"
+ echo ""
echo " item-update (downloads item DB. Must be run before searching)"
echo " item-search TERM1 TERM2 TERM3 ... (items: results contain all of the terms)"
+ echo ""
echo " mob-update (downloads monster DB. Must be run before searching)"
- echo " mob-search TERM1 TERM2 TERM3 ... (monsters: results contain all of the terms)"
- echo 'If you get and error while searching, it may contain special characters and needs to be quoted'
- echo 'gm searches, item-search, mob-search and cmds require periodic updating with their respective update commands'
- echo 'To avoid hammering servers, there will be no update-all option. Use gm-update before performing gm searches. \
-Use gm-show to quickly display the last 10 gm commands run (updates automatically)'
+ echo " mob-search TERM1 TERM2 TERM3 ... (monsters: results contain all of the terms)"
+ echo ""
+ echo " gm-update (downloads all GM logs. Should be run before searching)"
+ echo " gm-search TERM1 TERM2 TERM3 ... (results contain any of the terms)"
+ echo " gm-asearch TERM1 TERM2 TERM3 ... (results contain all of the terms)"
+ echo " gm-esearch TERM1 TERM2 TERM3 ... (results contain the exact term)"
+ echo " gm-show (if zenity is installed, displays a GUI pop-up of the last 10 issued GM CMDs), otherwise in terminal"
+ echo ""
+ echo "If you get and error while searching, it may contain special characters and needs to be quoted"
+ echo "gm searches, item-search, mob-search and cmds require periodic updating with their respective update commands"
+ echo ""
+ echo "To avoid hammering servers, there will be no update-all option. Use gm-update before performing gm searches."
+ echo "Use gm-show to quickly display the last 10 gm commands run (updates automatically)"
+ echo ""
+ echo "Always be respectful of people when navigating through logs. Do not abuse this tool."
+ intro_
}
-
if [ -z "$1" ]; then
- echo "Missing command"
+ echo "Missing command, cannot proceed"
help
exit 0
fi
@@ -67,7 +88,6 @@ fi
if [ "$1" == "gm-search" ] || [ "$1" == "gm-asearch" ] || [ "$1" == "gm-esearch" ] || [ "$1" == "item-search" ] || [ "$1" == "mob-search" ]; then
if [ -z "$2" ]; then
echo "Missing search terms"
- help
exit 0
fi
# If either the "logs" DIR doesn't exist or there are no files in the DIR
@@ -403,4 +423,3 @@ else
help
exit 0
fi
-