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?
December 02, 2008, 10:49:32 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: How to get Item ID from the items database
Pages: [1]   Go Down
« previous next »
Print
Author Topic: How to get Item ID from the items database  (Read 481 times)
0 Members and 1 Guest are viewing this topic.
onekman
Freshman
*
Offline Offline

Posts: 8


How to get Item ID from the items database
« on: April 06, 2008, 12:13:40 PM »

Hi,

Just wonder if anyone got an idea how to get the ItemsID from the database, if you know the item name ?

thx in advance

1k
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Re: How to get Item ID from the items database
« Reply #1 on: April 06, 2008, 04:15:15 PM »

you could use auno, search for item and look at address bar, it will contain lowID highID and ql
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
onekman
Freshman
*
Offline Offline

Posts: 8


Re: How to get Item ID from the items database
« Reply #2 on: April 07, 2008, 01:05:37 AM »

hehe k yeah sry, it seems I dident exlain my self correctly then, my mistake  Undecided

I want to get the Items id from inside a own delveloped PHP module in bebot, just by using the items name ? is that possible and if so how ?

Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: How to get Item ID from the items database
« Reply #3 on: April 07, 2008, 07:04:20 PM »

What you can do is to create a dummy module

create the command !raw and have the command handler var_dump($msg)

That will show you exactly what you get when you do !raw <drop item here>
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: How to get Item ID from the items database
« Reply #4 on: April 15, 2008, 01:58:29 PM »

Code:
<?php
$item_info 
= new item_info($bot);

$commands["tell"]["item"] = &$item_info;
$commands["pgmsg"]["item"] = &$item_info;
$commands["gc"]["item"] = &$item_info;

class 
item_info
{

var $bot;
function item_info (&$bot)
{
$this->bot = &$bot;

$this -> bot -> accesscontrol -> create('tell', 'item', 'GUEST');
$this -> bot -> accesscontrol -> create('gc', 'item', 'GUEST');
$this -> bot -> accesscontrol -> create('pgmsg', 'item', 'GUEST');

$this -> help['description'] = 'Searches the central database for information about an item.';
$this -> help['command']['items [ql] <item>']="Searches and displays information about an <item> of the optional [ql]";
$this -> help['notes']="This module uses the Central Items Database v1.1, By Vhab.";
}
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 . "item <a href=\"itemref:\/\/(.*)\/(.*)\/(.*)\">(.*)/i", $msg, $info))
return $this -> item($name, $info[1], $info[2], $info[3], $info[4]);
else
$this -> bot -> send_help($name);
}

function item($name, $lowid,$highid,$ql, $itemname)
{
$msg = "\n##normal## Item Name:##end## ##highlight##" . $itemname . "##end##";
$msg .= "\n##normal## Item ID (Low):##end## ##highlight##" . $lowid . "##end##";
$msg .= "\n##normal## Item ID (High):##end## ##highlight##" . $highid . "##end##";
$msg .= "\n##normal## Item QL:##end## ##highlight##" . $ql . "##end##";
$msg .= "\n##normal## Item Referance:##end## ##highlight##\n";
$msg .= "&lt;a href=\"itemref://" . $lowid . "/" . $highid . "/" . $ql . "\"&gt;" . $itemname . "&lt;/a&gt;##end##\n";
$msg .= "\n";
$msg .= "##normal## References:##end## ##highlight##\n";

$aunoURL = "http://auno.org/ao/db.php?id=" . $lowid . "&ql=" . $ql;
$msg .= "##normal## Auno:##end## " . $this -> bot -> make_chatcommand('start ' . $aunoURL,$itemname) . "\n";

$aomainframeURL = "http://aomainframe.com/showitem.aspx?AOID=" . $lowid . "&QL=" . $ql;
$msg .= "##normal## AOMainframe:##end## " . $this -> bot -> make_chatcommand('start ' . $aomainframeURL,$itemname) . "\n";

return $blob = "Item Information :: " . $this -> bot -> make_blob("click to view", $msg);
}
}
?>

Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: How to get Item ID from the items database
« previous next »
 
Jump to:  

Recent
!items database
by Zeephonz
[Today at 08:05:21 PM]

Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11146
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 11
Total: 12
Vain

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