summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xtmw-info15
2 files changed, 9 insertions, 7 deletions
diff --git a/README.md b/README.md
index 627db13..1bb5c06 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,7 @@ Use gm-show to quickly display the last 10 gm commands run. Updates automaticall
```
## Changelog
+* 2023-07-29 - Updated many server URLs to current.
* 2023-01-22 - mob-search was showing other incorrect info, since CRIT DEF was added to mob DB. Info shows correctly now and more info is shown
* 2023-01-06 - Fixed the ordering of the online list to ignore case, so it shows players in a more organized fashion
* 2023-01-04 - Fixed mob-search do display proper drops. This was due to a server DB update which added new columns
diff --git a/tmw-info b/tmw-info
index 2a7dd40..76b933f 100755
--- a/tmw-info
+++ b/tmw-info
@@ -10,6 +10,7 @@ CHAT_LOGS="$HOME/.local/share/mana/logs/server.themanaworld.org/"
months=(01 02 03 04 05 06 07 08 09 10 11 12)
thisYear=$(date -u +'%Y')
thisMonth=$(date -u +'%m')
+MAP_URL='https://git.themanaworld.org/legacy/serverdata/-/tree/master/world/map'
#Main DIR
TMW_INFO="$HOME/.tmw-info"
#Items DB DIR
@@ -78,7 +79,7 @@ mkdir -p "$TMW_INFO"
if [ "$1" == "help" ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
help
elif [ "$1" == "news" ]; then
- curl -s 'https://themanaworld.github.io/tmwa-server-data/news.html' | sed 's/<\/*[^>]*>//g' | less
+ curl -s 'https://updates.tmw2.org/legacy/news.txt' | sed 's/<\/*[^>]*>//g' | less
elif [ "$1" == "online" ]; then
curl -s 'https://server.themanaworld.org/' | sed 's/<\/*[^>]*>//g' | sed -r '/^\s*$/d' | sed -r '/^\s*Name\s*$/d' | grep --line-buffered -v 'Online Players' | sed 1d | sort -n
elif [ "$1" == "gm-update" ]; then
@@ -244,10 +245,10 @@ elif [ "$1" == "chat-search" ]; then
fi
elif [ "$1" == 'item-update' ]; then
mkdir -p "$ITEM_DIR"
- ITEM_FILES=($(curl -s 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'item_db.*\.txt'))
+ ITEM_FILES=($(curl -s "$MAP_URL/db" | sed 's/<\/*[^>]*>//g' | grep -o 'item_db.*\.txt'))
for ITEM_FILE in "${ITEM_FILES[@]}"; do
echo "Downloading $ITEM_FILE"
- curl -s "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$ITEM_FILE"\
+ curl -s "$MAP_URL/db/$ITEM_FILE"\
| grep -Eo '[0-9]+,\s*[a-zA-Z0-9]+,\s*[0-9]+,\s*[0-9]+,.*$|//ID,\s*Name.*$' | sed -E 's/<\/td>//g' | sed 's/&quot;//g'\
| sort -nu > "$ITEM_DIR/$ITEM_FILE"
done
@@ -284,10 +285,10 @@ $(echo "$LINE" | grep -o '{.*}' | sed 's/[,{}]//g' | sed 's/^\s*//g')\n"
done < "$TMW_INFO/item-search$LAST_COUNT.tmp"
elif [ "$1" == 'mob-update' ]; then
mkdir -p "$MOB_DIR"
- MOB_FILES="$(curl -s 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'mob_db.*\.txt')"
+ MOB_FILES="$(curl -s "$MAP_URL/db" | sed 's/<\/*[^>]*>//g' | grep -o 'mob_db.*\.txt')"
for MOB_FILE in $MOB_FILES; do
echo "Downloading $MOB_FILE"
- curl -s "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$MOB_FILE" \
+ curl -s "$MAP_URL/db/$MOB_FILE" \
| grep -Eo '[0-9]+,\s*[a-zA-Z0-9]+,\s*[a-zA-Z0-9]+,\s*[0-9]+,.*$|//ID,\s*Name.*$' | sed -E 's/<\/td>//g' | sed 's/&quot;//g' \
| sort -nu > "$MOB_DIR/$MOB_FILE"
done
@@ -365,10 +366,10 @@ elif [ "$1" == 'cmds-update' ];then
cat < "$TMW_CMDS/client" | sed -E 's/\s*$//g' | sort -u > "$TMW_CMDS/client.tmp"
mv -f "$TMW_CMDS/client.tmp" "$TMW_CMDS/client"
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"
+ wget -q -c -P "$TMW_CMDS" "$MAP_URL/conf/atcommand_athena.conf"
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"
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"
+ wget -q -c -P "$TMW_CMDS" "$MAP_URL/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"
elif [ "$1" == 'cmds' ];then
if [ ! -f "$TMW_CMDS/client" ] || [ ! -f "$TMW_CMDS/default_at" ] || [ ! -f "$TMW_CMDS/custom_at" ]; then