Linux script let you find card info Name/ID/Rarity

All add-on programm and tools for wagic
Locked
pasu11
Posts: 3
Joined: Wed Nov 10, 2010 11:28 pm

Linux script let you find card info Name/ID/Rarity

Post by pasu11 »

This is little script I wrote that returns Name/Rarity/Set if you enter card ID and returns ID/Rarity/Set if you enter Name.
This script can only be run via terminal; in order to use it, you have to create a launcher (Application in terminal) and run it from the icon.
There might be much better program that do this and much more but most of them have problem running under Linux. If you know any good Linux program that do the same thing or let you manage your decks, etc.. Please let me know =)

#!/bin/bash

# replace the directory with your wagic sets directory, and put ' ' around it if it contains space.
cd /media/Games/Wagic/Res/sets/
a1=cards
while true
do
echo "Please Enter Card Name or Number: "
echo
read card_val
reset

expr $card_val + 1 2> /dev/null
if [ $? = 0 ]
then
reset
echo Card Number\: $card_val
echo "============================================="
card_num="id="$card_val
cat */_cards.dat | grep -i "$card_num" -w -B 1 -A 1| cut -d "=" -f2

grep -i -w "$card_num" */_cards.dat | cut -d "/" -f1
else
reset
echo Card Name\: $card_val
echo "============================================="
grep -i "$card_val" -A 2 */_cards.dat | sed 's/\/_cards.dat\:primitive=/ : /g' | cut -d "=" -f2


fi
echo
echo "============================================="
echo
done
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Linux script let you find card info Name/ID/Rarity

Post by wololo »

Thanks!
pasu11
Posts: 3
Joined: Wed Nov 10, 2010 11:28 pm

Re: Linux script let you find card info Name/ID/Rarity

Post by pasu11 »

pleasure =)
Locked