From c1d2fc8a2481b4959f0eabb079fbab34d5c233f8 Mon Sep 17 00:00:00 2001 From: Ledmitz Date: Thu, 30 Jun 2022 23:44:42 +0000 Subject: cmds option has been greatly improved --- README.md | 6 ++++++ tmw-info | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 707d723..65e8d7c 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ tmw-info [command] [STRING] mob-update (downloads monster DB. Must be run before searching) mob-search TERM1 TERM2 TERM3 ... (monsters: results contain all of the terms) If you get and error while searching, it may contain special characters and needs to be quoted +gm searches, item-search, mob-search and cmds require periodic updating with their respective update commands +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) 2020-08-15 - fixed gm-show (wasn't showing GUI) and removed trailing comma in mob drops @@ -71,3 +74,6 @@ If you get and error while searching, it may contain special characters and need - added extra function to chat-search to view a log file easily after a search - fixed a bug that downloaded 2020-09 GM log everytime gm-update was run - added support for GM log files ending in "-old" (2020-09-old is a restored file) +2022-06-30 - corrected update-cmds to cmds-update and missing data from web sources now shows + - cmds now pulls text from the M+ binary and some commands have been added manually that were found by chance + - Added extra help text diff --git a/tmw-info b/tmw-info index 559efe0..712ca93 100755 --- a/tmw-info +++ b/tmw-info @@ -52,6 +52,9 @@ help(){ 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)' } @@ -361,24 +364,40 @@ MUTATIONS: $(echo "$LINE" | awk '{print $56}') MUTATION STR: $(echo "$LINE" | aw DROPS: $DROPS\n\ " done < "$TMW_INFO/mob-search$LAST_COUNT.tmp" -elif [ "$1" == 'update-cmds' ];then +elif [ "$1" == 'cmds-update' ];then mkdir -p "$TMW_CMDS" - echo "Downloading client commands..." + echo "Downloading and creating client command list..." wget -q -c -P "$TMW_CMDS" "https://wiki.themanaworld.org/index.php/User:Jak1/sandbox/client_commands" - echo "Downloading \"atcommand_athena.conf...\"" + grep -Eo '>/[a-z]+' "$TMW_CMDS/client_commands" | sed 's/^>//g' > "$TMW_CMDS/client" + grep -Eo '>/[a-z\,/]+' "$TMW_CMDS/client_commands" | sed 's/^>//g' >> "$TMW_CMDS/client" + grep -Eao '/[a-z]+ ' '/usr/games/manaplus' >> "$TMW_CMDS/client" + echo -e '/ipctoggle\n/targetmonster\n/movetotarget\n/attack\n/targetattack\n/untarget\n/where\n/navigate X Y\n/sethome\n/movetohome\n/present\n/all\n/pickup\n/useitem ID\n/disablehighlight\n/enablehighlight\n/sit\n/direct\n/turn[up,down,left,right]' >> "$TMW_CMDS/client" + #grep -Eo '>/[a-z\,/]+' "$TMW_CMDS/client_commands" | sed 's/^>//g' >> "$TMW_CMDS/client" + #grep -Eao '/[a-z]+ ' '/usr/games/manaplus' >> "$TMW_CMDS/client" + cat < "$TMW_CMDS/client" | sed -E 's/\s*$//g' | sort -u > "$TMW_CMDS/client.tmp" + mv -f "$TMW_CMDS/client.tmp" "$TMW_CMDS/client" + #rm "$TMW_CMDS/client_commands" + echo "Downloading and creating default at command list..." wget -q -c -P "$TMW_CMDS" "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/conf/atcommand_athena.conf" - echo "Downloading \"commands...\"" + sed 's/<\/*[^>]*>//g' "$TMW_CMDS/atcommand_athena.conf" | grep -Eo '[A-Za-z0-9]+: [0-9]+' "$TMW_CMDS/atcommand_athena.conf" | sort -u > "$TMW_CMDS/default_at" + #rm "$TMW_CMDS/atcommand_athena.conf" + echo "Downloading and creating custom at command list..." wget -q -c -P "$TMW_CMDS" "https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/npc/commands" + sed 's/<\/*[^>]*>//g' "$TMW_CMDS/commands" | grep -Eo '[A-Za-z0-9]+.txt' | sed 's/.txt$//g' | grep -v '^import$\|^procedures$' | sort -u > "$TMW_CMDS/custom_at" + #rm "$TMW_CMDS/commands" + elif [ "$1" == 'cmds' ];then - if [ ! -f "$TMW_CMDS/client_commands" ] || [ ! -f "$TMW_CMDS/atcommand_athena.conf" ] || [ ! -f "$TMW_CMDS/commands" ]; then - echo "You must run \"update-cmds\" first" + if [ ! -f "$TMW_CMDS/client" ] || [ ! -f "$TMW_CMDS/default_at" ] || [ ! -f "$TMW_CMDS/custom_at" ]; then + echo 'You must run "cmds-update" first' + else + (echo -e "\nClient Commands:" + cat < "$TMW_CMDS/client" + echo -e "\nDefault Server \"@\" Commands:" + cat < "$TMW_CMDS/default_at" + echo -e "\nCustom Server \"@\" Commands:" + cat < "$TMW_CMDS/custom_at") | less fi - (echo -e "\nClient Commands:" - (cat < "$TMW_CMDS/client_commands" | sed 's/<\/*[^>]*>//g' | grep -Eo '/[a-z]+ ' | sort -n | sed -E 's/\n/\t/g' & grep -Eao '/[a-z]+ ' '/usr/games/manaplus' & echo -e '/ipctoggle\n/targetmonster\n/movetotarget\n/attack\n/targetattack\n/untarget\n/where\n/navigate X Y\n/sethome\n/movetohome\n/present\n/all\n/pickup\n/useitem ID\n/disablehighlight\n/enablehighlight\n/sit\n/direct\n/turn[up,down,left,right]') | sort -u - echo -e "\nDefault Server \"@\" Commands:" - cat < "$TMW_CMDS/atcommand_athena.conf" | sed 's/<\/*[^>]*>//g' | grep -Eo '[A-Za-z0-9]+: [0-9]+' - echo -e "\nCustom Server \"@\" Commands:" - cat < "$TMW_CMDS/commands" | sed 's/<\/*[^>]*>//g' | grep -Eo '[A-Za-z0-9]+.txt' | sed 's/.txt$//g' | grep -v '^import$\|^procedures$') | less + else echo 'Incorrect syntax' help -- cgit v1.2.3-70-g09d2