It is currently 29 Oct 2025, 23:06
   
Text Size

Download deck from magic.tcgplayer.com

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Download deck from magic.tcgplayer.com

Postby Vasiliy » 22 Nov 2009, 20:33

Hello. I am beginner Java programmer.
I write code to download deck from magic.tcgplayer.com
How it work...
1. Select "Download Deck" from menu in Deck editor
Image
2. Enter deck URL, example: http://magic.tcgplayer.com/db/deck.asp?deck_id=474146
3. Deck downloads and analyzes.
If card from deck is unsupport from MTGForge, then this card is remove from deck.

I now, my code is not good, but i try.
Attachments
Gui_DeckEditor_Menu.zip
Source code
(8.33 KiB) Downloaded 337 times
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: Download deck from magic.tcgplayer.com

Postby silly freak » 22 Nov 2009, 20:59

hi and thanks! i think this is a cool feature. a note on your code: you could do much shorter ;)
java usually uses the "char" type when working with strings, you don't need to handle codepoints usually. the java.lang.Character class also has many utilities.

Code: Select all
temp=rStr.codePointAt(a);
if(temp>=48 && temp<=57)
can be written as
Code: Select all
if(Character.isDigit(rStr.charAt(a)))
or

Code: Select all
temp=rStr.codePointAt(a);
if(temp!=32)
as
Code: Select all
if(rStr.charAt(a) != ' ')
(this is also more readable, I had to look those up on the internet)

and again, thanks, and don't hestitate to ask for help
(and if you want, tell your native tongue, maybe we have someone in your language on the forum)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Download deck from magic.tcgplayer.com

Postby DennisBergkamp » 22 Nov 2009, 21:00

This definitely looks cool, thanks Vasiliy :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Download deck from magic.tcgplayer.com

Postby Vasiliy » 23 Nov 2009, 06:54

silly freak wrote:and if you want, tell your native tongue, maybe we have someone in your language on the forum
I am from Russia. My native language is russian.
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: Download deck from magic.tcgplayer.com

Postby zerker2000 » 24 Nov 2009, 07:42

Да есть русский на форуме, я:)(translation "yes there is a Russian guy on the forum: me").
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Download deck from magic.tcgplayer.com

Postby nantuko84 » 24 Nov 2009, 08:46

прикольно:)(translation "fine, we are not alone here").
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Download deck from magic.tcgplayer.com

Postby Vasiliy » 24 Nov 2009, 10:51

Вау. Рад знакомству.
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: Download deck from magic.tcgplayer.com

Postby Rob Cashwalker » 24 Nov 2009, 14:59

Vasiliy wrote:Вау. Рад знакомству.
And google says, "Wow. Glad acquaintance."

Добро пожаловать в сообщество программирования Forge.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Download deck from magic.tcgplayer.com

Postby Mr.Chaos » 24 Nov 2009, 18:53

Haha. Me and Dennis throw in a line in Dutch sometimes since we are both from the Netherlands.
To me, Russian looks odd because it uses letters/symbols that are not in the western alphabet.
](*,) = coder at work, according to a coder.It does explain some of the bugs. :wink:
Mr.Chaos
Tester
 
Posts: 625
Joined: 06 Sep 2008, 08:15
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 18 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 18 guests

Login Form