L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 06, 2008, 09:43:08 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: Whois-cache update script
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Whois-cache update script  (Read 588 times)
0 Members and 1 Guest are viewing this topic.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Whois-cache update script
« on: March 30, 2007, 06:29:53 AM »

This is a script that allows smart updating of the complete integrated whois cache in bebot 0.3 and higher. It will add and update the all members of all the orgs in the cache, as well as updating all orgless characters afterward. Stale entries that haven't been updated some time will be deleted.

After running the script outputs some statistical data.

To run the script put it into some directory (NOT the modules or core directories of the bot!), modify the .conf file to fit your needs and execute the script like every other php script (something along the lines of php whois-update.php. If there are entries in the cache it will update them. On empty caches it won't do anything.

The script to update the cache make sure this script is not in the modules or core directory!
Save as .php
The config file for the update script, add the infos here has to be in the same directory as the update script

PS: For a 0.2 version of this script and the cache check here
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Whois-cache update script
« Reply #1 on: March 30, 2007, 06:38:20 AM »

I've commited an optimized table structure for the whois cache to SVN today. It does exactly the same as before, just uses less memory to store the entries.

To update caches created with the old version use the following SQL query, just replace whois with the tablename you use if needed. Here is the ALTER query as text file for download.

Small warning: On large existing caches this query will take several minutes to run.
Code:
ALTER TABLE whois
DROP PRIMARY KEY,
DROP INDEX nickname,
ADD PRIMARY KEY (nickname),
CHANGE nickname nickname VARCHAR(15) NOT NULL DEFAULT '',
CHANGE firstname firstname VARCHAR(20) NOT NULL DEFAULT '',
CHANGE lastname lastname VARCHAR(20) NOT NULL DEFAULT '',
CHANGE level level TINYINT(3) UNSIGNED NOT NULL DEFAULT '1',
CHANGE gender gender ENUM('Female','Male','Neuter') NOT NULL DEFAULT 'Female',
CHANGE breed breed ENUM('Atrox','Nano','Opifex','Solitus') NOT NULL DEFAULT 'Atrox',
CHANGE faction faction ENUM('Clan','N/A','Neutral','Omni') NOT NULL DEFAULT 'Clan',
CHANGE profession profession ENUM('Adventurer','Agent','Bureaucrat','Doctor','Enforcer','Engineer','Fixer','Keeper','Martial Artist',
'Meta-Physicist','Nano-Technician','Shade','Soldier','Trader') NOT NULL DEFAULT 'Adventurer',
CHANGE defender_rank defender_rank ENUM('Able','Accomplished','Adept','Amateur','Backer','Beginner','Challenger','Champ','Common',
'Competent','Defender','Fair','Fledgling','Guardian','Hero','Intermediate','Medalist','Mediocre','Newcomer',
'None','Patron','Protector','Qualified','Starter','Student','Suited','Supporter','Talented','Trustworthy',
'Vanquisher','Vindicator') NOT NULL DEFAULT 'Able',
CHANGE defender_rank_id defender_rank_id ENUM('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19',
'20','21','22','23','24','25','26','27','28','29','30') NOT NULL DEFAULT '0',
CHANGE org_id org_id bigint(10) NOT NULL DEFAULT '0',
CHANGE org_name org_name VARCHAR(50) NOT NULL DEFAULT '',
CHANGE org_rank org_rank VARCHAR(20) NOT NULL DEFAULT '',
CHANGE org_rank_id org_rank_id ENUM('0','1','2','3','4','5','6','7','8','9','10') NOT NULL DEFAULT '0',
ADD KEY ID (ID),
ADD KEY Profession (profession),
ADD KEY Faction (faction),
ADD KEY OrgID (org_id),
ADD KEY Orgname (org_name),
ADD KEY Level (level),
ADD KEY Alienlevel (defender_rank_id);
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Whois-cache update script
« Reply #2 on: April 06, 2007, 08:30:06 PM »

Suggest adding this to SVN along with usage instructions.
Should go into an extras/ folder Smiley
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Whois-cache update script
« Reply #3 on: April 07, 2007, 03:27:51 AM »

Sure, I'll go add it with a README then.
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 155


WWW
Re: Whois-cache update script
« Reply #4 on: April 07, 2007, 04:18:51 AM »

There's there could be a file containing upgrade instructions and version numbers.
To upgrade your bot you just locate your own version in the file and follow all instructions from that point to the version you're upgrading to
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Whois-cache update script
« Reply #5 on: April 07, 2007, 06:22:51 AM »

Quote from: Alreadythere on April 07, 2007, 03:27:51 AM
Sure, I'll go add it with a README then.
Perhaps it would be a good idea to update the wiki too.

Edit = I know I should preview before post.. :p
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1022


Re: Whois-cache update script
« Reply #6 on: April 08, 2007, 08:49:51 AM »

Added the script to SVN under extra/whois-update/ with a simple README file.

I'll try to get around to add a wiki entry too.
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: Whois-cache update script
« previous next »
 
Jump to:  

Recent
Security
by Alreadythere
[Today at 10:02:42 AM]

Probs with relay from gue...
by Temar
[Today at 09:03:06 AM]

Raid spam in guild chat
by Temar
[Today at 09:01:18 AM]

Org Relaying
by Nytridr
[Today at 01:34:35 AM]

Link 2 Guilds via 2 Bots?
by Temar
[September 05, 2008, 04:22:40 PM]

SVN download
by clashbot
[September 05, 2008, 05:12:59 AM]

TWC
by Temar
[September 05, 2008, 12:27:23 AM]

How to find the guild ID?...
by Irinir
[September 03, 2008, 02:58:54 PM]

Deactivate Autoadding mem...
by Temar
[September 03, 2008, 02:49:01 PM]

0.4 Modules in 0.5 -- fou...
by Temar
[September 03, 2008, 11:06:42 AM]
Stats
Members
Total Members: 961
Latest: daltarak
Stats
Total Posts: 10408
Total Topics: 1412
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 19
Total: 20
Jlee

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.938 seconds with 29 queries. (Pretty URLs adds 0.027s, 4q)
Loading...