Note: Registered users gain access to additional site features and can even change the way this site looks.

Notice: most of this site will require javascript and cookies in order to work properly. Please enable them.

Navigation

AO Tools

External Links
It is currently 07 Sep 2010 15:53

All times are UTC


 




Post new topic Reply to topic  [ 37 posts ]  Go to page | Previous | 1, 2, 3, 4
Author Message
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 03 Feb 2010 19:27 
Site Admin
Offline
User avatar

Joined: Mar 06, 2009
Posts: 185
Dimension: Atlantean (RK-1)
Org: Eventide
Main: Bitbucket
Hallo, welches Programm Sie die Analyse der Daten mit? ist es möglich, fügen Sie das Plugin-Codierung auf und ich entschuldige mich für das Fehlen der Kodierung Spezifikation

_________________
- Bitbucket, RK1


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 03 Feb 2010 22:12 
Offline

Joined: Feb 02, 2010
Posts: 3
Dimension: Die Neue Welt (RK-3)
hi xyphos, thx for reply :-)

i m one of that perl fanatics, and dont have Visual Studio or things like that. so i cant look at the xml-output-plugin myself :-/

what i m trying to do is parse a full xml file (from your nicely app) with perl module XML::Twig which uses the encoding mentioned in the xml tag. if theres no enconding it uses utf-8 for default. i can also set a specific encoding but dont know which :D

running your app on a XP service pack 3, installed .net frame 3.5.

goal is to parse the xml into a mysql database connected with my perl org bot (parsing should be done later on my debian server, so if new db version is out, i just need to upload the xml produced by your app). i can parse that huge xml chunk by chunk by perl. if all running i ll post my code on aodev.com for sharing (perhaps there are some like running perl bot and db than slower php).

perhaps if possible, tell me how you have done your db?


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 04 Feb 2010 11:10 
Site Admin
Offline
User avatar

Joined: Mar 06, 2009
Posts: 185
Dimension: Atlantean (RK-1)
Org: Eventide
Main: Bitbucket
Wow. I've not coded in pearl in years since I started using PHP.

if it's org bot items you want, there is a much simpler way.
this website also hosts a public interface for org bots that behaves exactly like vhabot's central items database. in fact, Vhab has updated his bot plugin to use this website as the default items database.

to use it, you need to make an HTTP transaction from within pearl.

$cidb_server = "http://cidb.xyphos.com";
$url = $cidb_server;
$url .= '?bot=<BotNameGoesHere>';
$url .= '&search=' . urlencode( <Item You're Looking For>);
$url .="&output=<Format>"; //valid formats are: aoml, xml, text
if($ql) { $url .= '&ql=' . $ql; } // add a QL specification if supplied
$content = HTTP::Get($url);

$content will depend on what you provided as the output parameter. if it was aoml, you'll get back an "AO HTML" script that you can put directly into AO chat.
if it was xml, you'll get an XML document (UTF-8) that you could parse in your own way.
text will give you a plain-text version separated by ;'s if you want to customize the output

item searches can be done the same manner as a google search.
example: !items sword kyr -energy
will give you all of the items named like "sword kyr" (Kyr'Ozch Sword included) but filter out the results containing the word "Energy"
you can use as many words and/or filters as you wish.

as for this database here, it is created and updated by a custom tool XRDB3.
XRDB4 was released to the public while XRDB3 is a private tool that is too unstable and unfit for a public release.
XRDB3 reads directly from AO's database, stores information as a SQLite3 database, does some extra stuff at the end then dumps a .sql file to be uploaded and used from an SSH login.

if you use the CIDB mentioned above, it'll save you the trouble of having to constantly update your bot's database :)

As for the encoding problem, I've added UTF-8 to the plugin.
download version 4.6.1 from the first page in this thread.

also, if you're interested, this website hosts another public interface http://inits.xyphos.com which will show you a dozen init calculations for any given weapon.
url parameters are lowid, highid, ql and output (output being the same as cidb)
you can get the lowid/highid/ql information just by dropping the item into chat.

_________________
- Bitbucket, RK1


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 04 Feb 2010 18:12 
Offline

Joined: Feb 02, 2010
Posts: 3
Dimension: Die Neue Welt (RK-3)
#!/usr/bin/perl
use strict;
use warnings;

use XML::Twig;

my $file = 'XRDB4_Plugins-XMLOutput_18-03-01-00_FULL.xml';
our $i = 0;
my $twig = new XML::Twig( twig_handlers => { Item => \&insert_record } );
$twig -> parsefile( $file );
print "total Items parsed: $i";
exit;

#doing for each Item
sub insert_record {
( my $twig, my $data )= @_;
$i = $i + 1;
#working on each Item ($data)
$twig->purge;
}


running on

a) produced full xml output of nanos works fine
b) produced full xml output of items fails
c) produced full xml output items+nano fails


btw, thx for your offer for using your restfull db search.


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 22 Aug 2010 23:21 
Offline

Joined: Aug 16, 2010
Posts: 8
Dimension: Atlantean (RK-1)
Main: Prodigy007
Can we please add sql as a save source instead of xml? I cant seem to wrap myself around how to export the very same data as sql without a loss in some of the information. Im just plain stumped. Id pay for the ability to save to sql if someone had a simple enough solution for me.

thx


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 24 Aug 2010 15:40 
Site Admin
Offline
User avatar

Joined: Mar 06, 2009
Posts: 185
Dimension: Atlantean (RK-1)
Org: Eventide
Main: Bitbucket
parsing to sql would depend on how you want your sql schema.
since schemas would vary alot, there's no way I could code a sql plugin.

if you want to store the entire database with version support,
here's one of my old schema purposals

this schema is no longer supported by this website, but uses a variant of it.

_________________
- Bitbucket, RK1


Top
 Profile  
 
 Post subject: Re: XRDB4 - Xyphos Resouce Database Tool v4
PostPosted: 25 Aug 2010 01:04 
Offline

Joined: Aug 16, 2010
Posts: 8
Dimension: Atlantean (RK-1)
Main: Prodigy007
Well parsing it anyway would be great. So long as I can import it with the same attributes and arguments as listed in the xml. Theres a little program called Advanced xml converter that does the trick, but its sloppy going from your xml output to sql.
I would pay money to see it just come straight out of your program than to go through another parser.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page | Previous | 1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.388s | 16 Queries | GZIP : On ]