collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Central Items Database (With Icons)  (Read 32672 times)

0 Members and 1 Guest are viewing this topic.

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Central Items Database (With Icons)
« on: April 26, 2006, 06:54:06 am »
Made this plugin for someone that requested here on the boards.
But I figured I'd properly release it over here too.

This plugin allows you to search vhabot's central items database from ingame.
This database is located at a remote location and won't require installing or updating on your side.
It supports searching for specific QL's and will display the item icon.
At the top there are several configuration settings you can change to suit it more to your liking

Preview of the output:


Code: [Select]
<?
/*
 * Central Items Database v1.1, By Vhab
 * Latest version can always be found at: http://bebot.link/index.php/topic,380.0.html
 * Details about the database itself: http://aodevs.com/index.php/topic,84.0.html
 */
$VhItems = new VhItems($bot);

$commands["tell"]["items"] = &$VhItems;
$commands["pgmsg"]["items"] = &$VhItems;
$commands["gc"]["items"] = &$VhItems;

class VhItems
{
var $icons = 'true';
var $color_header = 'DFDF00';
var $color_highlight = '97BE37';
var $color_normal = 'CCF0AD';
var $server = 'http://items.vhabot.net/';
var $max = 50;

var $bot;
function VhItems (&$bot)
{
$this->bot = &$bot;
}
function tell($name, $msg)
{
$this->bot->send_tell($name, $this->process_command($name, $msg));
}
function pgmsg($name, $msg)
{
$this->bot->send_pgroup($this->process_command($name, $msg));
}

function gc($name, $msg)
{
$this->bot->send_gc($this->process_command($name, $msg));
}

function process_command($name, $msg)
{
if (preg_match('/^'.$this->bot->commpre.'items/i', $msg, $info)) {
$words = trim(substr($msg, strlen($this->bot->commpre.'items')));
if (!empty($words)) {
$parts = explode(' ', $words);
if (count($parts) > 1 && is_numeric($parts[0])) {
$ql = $parts[0];
unset($parts[0]);
$search = implode(' ', $parts);
} else {
$ql = 0;
$search = $words;
}
$url  = $this->server;
$url .= '?bot=BeBot';
$url .= '&output=aoml';
$url .= '&max='.$this->max;
$url .= '&search='.urlencode($search);
$url .= '&ql='.$ql;
$url .= '&icons='.$this->icons;
if ($this->color_header)
$url .= '&color_header='.$this->color_header;
if ($this->color_highlight)
$url .= '&color_highlight='.$this->color_highlight;
if ($this->color_normal)
$url .= '&color_normal='.$this->color_normal;

$result = file_get_contents($url);
if (!empty($result))
return $result;
else
return "Unable to query database";
} else {
return "Usage: items [quality] [item]";
}
} else {
$this -> bot -> send_help($name);
}
}
}
?>
« Last Edit: December 15, 2006, 04:51:44 pm by Vhab »

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Central Items Database (With Icons)
« Reply #1 on: May 15, 2006, 07:05:17 pm »
This is now the default items plugin for BeBot.
Thanx Vhab.
BeBot Founder and Fixer Kingpin

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Central Items Database (With Icons)
« Reply #2 on: June 22, 2006, 08:24:09 am »
Yeah, looks great.

*shakes fist at the select few who took credit for "making" that plugin*
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

joey12344

  • Guest
Re: Central Items Database (With Icons)
« Reply #3 on: June 29, 2006, 07:46:34 pm »
Uber vhab :) Glad you put it into bebot

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Central Items Database (With Icons)
« Reply #4 on: July 27, 2006, 06:15:48 pm »
Oddly, this module won't work properly with PHP 5.1.4.

The " 4 items found -Click here- " gets displayed, but nothing is showed inside the blob.

Any ideas what needs to be fixed? I can't find anything as to what's wrong with it.
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Central Items Database (With Icons)
« Reply #5 on: July 27, 2006, 07:49:04 pm »
That's very very odd.
All the module does it pass the input it gets to the website and displays what it receives.
That includes the message and link.
Nothing version specific to that could possibly break the blob.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Central Items Database (With Icons)
« Reply #6 on: July 27, 2006, 09:59:34 pm »
Using it on php 5.1.4 here and no issues.
BeBot Founder and Fixer Kingpin

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: Central Items Database (With Icons)
« Reply #7 on: July 28, 2006, 02:26:50 am »
I figured out what was wrong.

In order to use that module, you need PHP5-XSL extension installed (LoadModule in the httpd.conf)

Hope if someone comes across the same issue that helps them =)
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Nogoal

  • BeBot Apprentice
  • ***
  • Posts: 77
  • Karma: +0/-0
Re: Central Items Database (With Icons)
« Reply #8 on: October 02, 2006, 05:16:11 pm »
looks like your DB doesn't have Shade spirits, can someone confirm this?

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Central Items Database (With Icons)
« Reply #9 on: October 02, 2006, 05:40:24 pm »
I know the database does not have implants (which i occationally miss), and as such i would assume it also is missing Spirits and possibly Symbiants?
BeBot Founder and Fixer Kingpin

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Central Items Database (With Icons)
« Reply #10 on: October 02, 2006, 06:04:59 pm »
It has symbiants. not having implants is intended because it's huge spam. half the entries in the entire database are implants.
I'll look into spirits.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Central Items Database (With Icons)
« Reply #11 on: November 27, 2006, 04:40:08 pm »
This database is located at a remote location and won't require installing or updating on your side.

How often do you plan on updating it on your side?

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Central Items Database (With Icons)
« Reply #12 on: December 15, 2006, 04:53:39 pm »
Updated the database to 17.0.0_EP1
Updated the plugin to v1.1

Changelog:
- New URL for the central database
- Added several settings to configure the output
- Made the default colors more like most BeBot plugins to be better suited as official plugin.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Central Items Database (With Icons)
« Reply #13 on: December 15, 2006, 05:28:07 pm »
Any chance of getting an SQL of the new items?
Eternalist
General of The Syndicate

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Central Items Database (With Icons)
« Reply #14 on: December 15, 2006, 05:48:39 pm »
Any chance of getting an SQL of the new items?
Nope sorry.
1. i updated the db completely using a new dump (last dump has some issues so no incremental changes this time). so don't have track of the changes
2. it's a huge db spread over different tables (not a tiny db like the sql items module has)
3. it took me quite alot of work to put together the db and get various scripts to work together outputs from different tools and run fixes on that output, i prefer to make all that work available just through the central db.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 560
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal