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?
October 07, 2008, 05:14:13 AM

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 429 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: 773



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
!points
by IKShadow
[Today at 05:00:38 AM]

TWC
by Temar
[Today at 02:49:27 AM]

raid/point system suggest...
by Vain
[October 06, 2008, 08:53:00 PM]

!items database
by cthulhu
[October 05, 2008, 11:36:16 AM]

Supplies needed module
by viper
[October 05, 2008, 11:11:13 AM]

Assist
by Foxy
[October 05, 2008, 05:09:02 AM]

How's 0.5.x coming? Wonde...
by Hyde
[October 04, 2008, 04:59:20 PM]

Org in AoC
by Alreadythere
[October 04, 2008, 04:50:00 AM]

OnlineOrg
by Slacklin
[October 04, 2008, 03:06:00 AM]

Learning .NET, Mono, C#, ...
by Vhab
[October 04, 2008, 02:39:03 AM]
Stats
Members
Total Members: 983
Latest: Titerris
Stats
Total Posts: 10744
Total Topics: 1449
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 9
Guests: 63
Total: 72
upstart
Karsta
Csavarkulcs
Mildar
IKShadow
Baja
cthulhu
Noer
Wolfbiter

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