summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLedmitz <smoothshifter@tuta.io>2022-06-30 23:44:42 +0000
committerLedmitz <smoothshifter@tuta.io>2022-06-30 23:44:42 +0000
commitc1d2fc8a2481b4959f0eabb079fbab34d5c233f8 (patch)
tree307f729899f1d036f0d50ca6bce19488dba4582e
parentb01b2fc263db4ba525abe0fb3995654d8fd88f3a (diff)
downloadtmw-info-c1d2fc8a2481b4959f0eabb079fbab34d5c233f8.tar.gz
tmw-info-c1d2fc8a2481b4959f0eabb079fbab34d5c233f8.tar.bz2
tmw-info-c1d2fc8a2481b4959f0eabb079fbab34d5c233f8.tar.xz
tmw-info-c1d2fc8a2481b4959f0eabb079fbab34d5c233f8.zip
cmds option has been greatly improvedcmds_updt1
-rw-r--r--README.md6
-rwxr-xr-xtmw-info43
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