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: How to get Item ID from the items database  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

Offline onekman

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
How to get Item ID from the items database
« on: April 06, 2008, 07: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

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: How to get Item ID from the items database
« Reply #1 on: April 06, 2008, 11:15:15 pm »
you could use auno, search for item and look at address bar, it will contain lowID highID and ql

Offline onekman

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: How to get Item ID from the items database
« Reply #2 on: April 07, 2008, 08:05:37 am »
hehe k yeah sry, it seems I dident exlain my self correctly then, my mistake  :-\

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 ?


Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: How to get Item ID from the items database
« Reply #3 on: April 08, 2008, 02:04:20 am »
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>
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: How to get Item ID from the items database
« Reply #4 on: April 15, 2008, 08:58:29 pm »
Code: [Select]
<?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);
}
}
?>


 

* 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: 761
  • 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