From e0f71f6b51872e9e3bf0e15812aa1854d7b2cf05 Mon Sep 17 00:00:00 2001 From: Ledmitz Date: Sat, 15 Aug 2020 04:03:18 +0000 Subject: Fixed gm-show GUI and removed trailing comma in mob drops --- README.md | 3 +++ tmw-info | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de89b10..b59a868 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,6 @@ e.g. tmw-info gm-asearch @item phylactery (no results? check item ID) If you get an error while searching, it may contain special characters and needs to be quoted' + +2020-08-15 - fixed gm-show (wasn't showing GUI) and removed trailing comma in mob drops + diff --git a/tmw-info b/tmw-info index 421b0a6..db11a14 100755 --- a/tmw-info +++ b/tmw-info @@ -41,7 +41,7 @@ help(){ 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 " gm-show (if zenity is installed, displays a GUI pop-up of the last 10 issued GM CMDs), otherwise in terminal" 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 " mob-update (downloads monster DB. Must be run before searching)" @@ -209,7 +209,7 @@ elif [ "$1" == 'gm-show' ]; then fi fi fi - if [[ $(dpkg -l 'zenity' | awk '{print $1}') == 'ii' ]]; then + if [[ $(dpkg -l 'zenity' | grep -Eo '^ii') == 'ii' ]]; then zenity --text-info 'tmw-gmlog' --width '600' --height '300' --filename "$GM_REPORT" else cat < "$GM_REPORT" @@ -329,7 +329,7 @@ elif [ "$1" == "mob-search" ]; then mv "$TMW_INFO/mob-drops-$MOB_ID.tmp.tmp" "$TMW_INFO/mob-drops-$MOB_ID.tmp" DROP_COUNT=$(( DROP_COUNT + 1 )) done - DROPS=$(cat < "$TMW_INFO/mob-drops-$MOB_ID.tmp" | sed 's/^$//g') + DROPS=$(cat < "$TMW_INFO/mob-drops-$MOB_ID.tmp" | sed 's/^$//g' | sed -E 's/,\s*$//g') echo -e "\ ID: $(echo "$LINE" | awk '{print $1}') NAME: $(echo "$LINE" | awk '{print $2 $3}') LVL: $(echo "$LINE" | awk '{print $4}')\n\ HP: $(echo "$LINE" | awk '{print $5}') SP: $(echo "$LINE" | awk '{print $6}') \ -- cgit v1.2.3-70-g09d2