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?
August 29, 2008, 08:59:36 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 383 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: 684



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
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
Dont get any TowerAttack ...
by Ziodberg
[Today at 06:15:35 PM]

Org Relaying
by Nytridr
[Today at 03:43:06 PM]

Auto reinvite not setting...
by Temar
[Today at 02:12:59 PM]

Link 2 Guilds via 2 Bots?
by Nytridr
[Today at 01:19:39 PM]

Question about Logon.php
by Temar
[Today at 07:17:13 AM]

MOTD module from 2.x to 4...
by Karsta
[Today at 04:14:55 AM]

Upcoming Channels
by Temar
[Today at 04:00:07 AM]

Reducing the load on a se...
by Alreadythere
[August 28, 2008, 03:29:35 PM]

Ported Modules
by krommel
[August 28, 2008, 12:01:19 PM]

Communication between gui...
by Temar
[August 27, 2008, 08:28:49 PM]
Stats
Members
Total Members: 949
Latest: pobo
Stats
Total Posts: 10356
Total Topics: 1406
Online Today: 20
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 33
Total: 35
chamoul
Chakki

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.509 seconds with 28 queries. (Pretty URLs adds 0.113s, 4q)
Loading...