BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Module Requests => Topic started by: Plac3bo on August 31, 2005, 09:38:06 am

Title: Itemsdatabase for 15.9.6?
Post by: Plac3bo on August 31, 2005, 09:38:06 am
I know this isnt a module... but the 15.8.4 database is somewhat outdated.. what do you others do?
Title: Itemsdatabase for 15.9.6?
Post by: Zacix on August 31, 2005, 10:33:47 am
I'm working on a new items module. As you've probably noticed, Blondengy isn't developing on BeBot right now. Making the list of items the way it is now is very timeconsuming (lowid/highid), so I will create an easier way to update the itemsfile.
Title: Itemsdatabase for 15.9.6?
Post by: Blondengy on August 31, 2005, 11:35:56 am
ItemsDB 15.9.2 (http://bebot.fieses.net/files/items150902.zip)

Sorry, Auno only had the 15.9.2 XML on his site and I don't have AO installed... ;) At least its a bit newer then the old one... Hope it helps!

And Zacix, yes, it takes more CPU load to create the high/lowid thingys when creating the mysql database, but in return a query takes less CPU load... ;)
Title: Itemsdatabase for 15.9.6?
Post by: Zacix on August 31, 2005, 12:57:53 pm
Quote from: "Blondengy"
ItemsDB 15.9.2 (http://bebot.fieses.net/files/items150902.zip)

Sorry, Auno only had the 15.9.2 XML on his site and I don't have AO installed... ;) At least its a bit newer then the old one... Hope it helps!

And Zacix, yes, it takes more CPU load to create the high/lowid thingys when creating the mysql database, but in return a query takes less CPU load... ;)


Problem is that you can't just parse everything as lowid/highid. There are quite a few special cases like NCU chips. That means that you manually have to edit some items, in which case I don't intend to do for every update.
Title: Itemsdatabase for 15.9.6?
Post by: Plac3bo on August 31, 2005, 05:27:32 pm
blondengy, do you use a special program to convert the xml to .sql file? in that case could you post it? or do you have to have aunos.xml?
On aodb.info there is a tool extracting the db wich can output it to xml.
There is also a sql output, but its not for mysql.

I dont know, if you want the resourece file from newest ao for that program without installing it, send me a privmsg here with talk/msn adress and I can send it, or out it on my webserver as zip file so you can download it and look at it :)
Title: Itemsdatabase for 15.9.6?
Post by: Xenixa on August 31, 2005, 07:08:47 pm
Eeem silly question about your choice of SQL Syntax.
But why drop the table if it exists? I find it easier/faster to update the table with REPLACE INTO rather than INSERT INTO.

Ex:
Code: [Select]
CREATE TABLE IF NOT EXISTS `items` (
  `lowid` int(11) NOT NULL default '0',
  `highid` int(11) NOT NULL default '0',
  `lowql` int(11) default NULL,
  `highql` int(11) default NULL,
  `name` varchar(150) default NULL,
  PRIMARY KEY (`lowid`)
) TYPE=MyISAM;

REPLACE INTO `items` VALUES (21601, 21601, 1, 1, 'Flamethrower Ammunition');
REPLACE INTO `items` VALUES (21605, 21605, 1, 1, 'Bullets');
REPLACE INTO `items` VALUES (21609, 21609, 1, 1, 'Energy Weapon Ammo');
REPLACE INTO `items` VALUES (21613, 21613, 1, 1, 'Shotgun Shells');

Etc... Etc..


If that row exists it will skip it... if it's not present then it'll insert it.
NOTE: Unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE statement will make no sense. It becomes equivalent to INSERT, because there is no index to be used to determine whether a new row duplicates another.

EDIT: On 2nd thought, don't mind me. I'm just being an old crotchety DB Admin. :)
Title: Itemsdatabase for 15.9.6?
Post by: Zacix on August 31, 2005, 10:19:42 pm
Quote from: "Xenixa"

If that row exists it will skip it... if it's not present then it'll insert it.


That's actually wrong....REPLACE INTO will update the row if it exist, hence u need an primary key to make it useful. If the row doesn't exist, it will just insert it normally.
SimplePortal 2.3.7 © 2008-2024, SimplePortal