Page 1 of 1

Allakhazam Item Parser

PostPosted: Tue Mar 23, 2010 9:10 pm
by geshi
Here is version 1.0..

Some stats may not work (if so then please tell me which!) and also tell me any other bugs :)

Make sure you copy from the right hand side just above the item picture to above the item picture to the top of the item name then paste it into the big textBox and click the TO SQL! button and then it will put the SQL in the huge textBox AND create a .txt file containing all the sql so far:)

Re: Allakhazam Item Parser

PostPosted: Tue Mar 23, 2010 9:30 pm
by Graveen
Yes, you have to parse it now.

Re: Allakhazam Item Parser

PostPosted: Tue Mar 23, 2010 9:36 pm
by bluraven
For a good reference, try the google translate script. It uses a webclient, and parses the result.

Re: Allakhazam Item Parser

PostPosted: Tue Mar 23, 2010 11:17 pm
by geshi
ah nice thanks..
Code: Select all
string url = "http://www.google.com";
WebClient webClient = new WebClient();
webClient.Encoding = System.Text.Encoding.UTF8;
try
{
string result = webClient.DownloadString(url);
//find the translation result and cut off everything before it.
result = result.Substring(result.IndexOf("result_box dir=") + 21, 500);
//find the end of the translation and cut off everything after it.
result = result.Substring(0, result.IndexOf("</div>"));
//what you should have left is the pure translation result.
MessageBox.Show(result);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
that is my code now but it says "Length cannot be less then zero", it seems its this line "result = result.Substring(0, result.IndexOf("</div>"));"

anyone know ? :( sry guys

Re: Allakhazam Item Parser

PostPosted: Wed Mar 24, 2010 9:44 am
by Graveen
Geshi. PM inc.

Re: Allakhazam Item Parser

PostPosted: Wed Mar 24, 2010 3:19 pm
by Roozzz
Question,

After toying around some things raised questions:
Code: Select all
REPLACE INTO `mobxloottemplate` (`MobXLootTemplate_ID`, `MobName`,`LootTemplateName`, `DropCount`) VALUES ('Gjalpinulva12686','Gjalpinulva','Gjalpinulva','2');

REPLACE INTO `loottemplate` (`LootTemplate_ID`, `TemplateName`, `ItemTemplateID`, `Chance`) VALUES ('Gjalpinulva12686','Gjalpinulva','TWOHAND_Sword_Dragonfury','25');
I was wondering where the LootTemplate_ID comes from?
I suppose this is randomly generated, or is there any logic behind it? And a way to prevent duplicates? (Since you use the Replace into this could go quite unnoticed).

And another small thing, instructions in a readme or inside the program would be nice, apart from the one in this thread ofcourse. Just to make things more clear.

Further then this, it seems to work fine :)

Re: Allakhazam Item Parser

PostPosted: Wed Mar 24, 2010 3:26 pm
by geshi
Code: Select all
MobName + Random.ToString()
thats for LootTemplate_ID !

Re: Allakhazam Item Parser

PostPosted: Wed Mar 24, 2010 4:08 pm
by Tolakram
Use GUID instead of a simple random number for the key field.

System.Guid.NewGuid().ToString()

Re: Allakhazam Item Parser

PostPosted: Thu Mar 25, 2010 1:10 am
by Merec
A long time ago, I've created a parser for Items based on PHP. Currently it supports only German items (http://items.bruderschaft-des-chaos.de).
U delve an Item into a chatlog and upload it, the rest is done by the parser. Maybe ... I can do smth. like this for English Items.

Gretings,
Merec

Re: Allakhazam Item Parser

PostPosted: Tue Mar 30, 2010 12:21 am
by stephenxpimentel
The only thing that sucks is that it has to be done with items IN your inventory =/