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

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

Author Topic: !inspect command -- please unhack?  (Read 8983 times)

0 Members and 1 Guest are viewing this topic.

Offline Bubbagrunt

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
!inspect command -- please unhack?
« on: December 11, 2005, 08:17:02 pm »
Description:
This module deciphers what Alien Biomaterial will refine into.  I took the base functionality from an IGN module.

Commands:

!inspect <item ref> (Can be used in tells, privategroup and guildchat)

I was wondering if someone was willing to turn this code into a "real" module.  It works, but it's an oogly hack I know.  Also, I have nowhere to host this right now, as my webserver has temporarily melted.

Code: [Select]
<?php
/*
* Inspect.php - A Utility Module
* For Bebot - An Anarchy Online Chat Automaton Developed By Blondengy (RK1)
*
* Module migrated to bebot by <some_non_hacker>. Originial by Drevi1
*
* As usual place this file in ./modules
*
*/

/*
 Add a "_" at the beginning of the file (_Inspect.php) if you do not want it loaded.
*/
$inspect = new Inspect($bot);

$commands["gc"]["inspect"] = &$inspect;
$commands["tell"]["inspect"] = &$inspect;
$commands["pgmsg"]["inspect"] = &$inspect;

class Inspect
{
var $bot;
var $idn;

/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function Inspect (&$bot)
{
$this -> bot = &$bot;

// load our types
$this -> idn[247102] = "Pristine";
$this -> idn[247104] = "Mutated";
$this -> idn[247105] = "Pristine/Mutated";
$this -> idn[247697] = "Type 76";
$this -> idn[247698] = "Type 76";
$this -> idn[247699] = "Type 112";
$this -> idn[247700] = "Type 112";
$this -> idn[247701] = "Type 240";
$this -> idn[247702] = "Type 240";
$this -> idn[247703] = "Type 880";
$this -> idn[247704] = "Type 880";
$this -> idn[247705] = "Type 992";
$this -> idn[247706] = "Type 992";
$this -> idn[247707] = "Type 1";
$this -> idn[247708] = "Type 1";
$this -> idn[247709] = "Type 2";
$this -> idn[247710] = "Type 2";
$this -> idn[247711] = "Type 4";
$this -> idn[247712] = "Type 4";
$this -> idn[247713] = "Type 5";
$this -> idn[247714] = "Type 5";
$this -> idn[247715] = "Type 12";
$this -> idn[247716] = "Type 12";
$this -> idn[247717] = "Type 3";
$this -> idn[247718] = "Type 3";
$this -> idn[247719] = "Type 13";
$this -> idn[247720] = "Type 13";
$this -> idn[247764] = "Viral Serum";
$this -> idn[254804] = "Viral Serum";
$this -> idn[256035] = "Useless";
$this -> idn[205844] = "Karlsson Propellor Cap";
$this -> idn[205843] = "Monster Sunglasses";
$this -> idn[205842] = "Funny Arrow";
}

/*
This gets called on a tell with the command
*/
function tell($name$msg)
{
$this -> bot -> send_tell($name$this -> decode_item($name$msg));
}

/*
This gets called on a msg in the privgroup with the command
*/
function pgmsg($name$msg)
{
$this -> bot -> send_pgroup($this -> decode_item($name$msg));
}

/*
This gets called on a msg in the guildchat with the command
*/
function gc($name$msg)
{
$this -> bot -> send_gc($this -> decode_item($name$msg));
}

function decode_item($name$msg)
{
$regex    '#<a href=[\'"]itemref://([0-9]+)/([0-9]+)/([0-9]+)[\'"]>(.+?)</a>#i';
$words    str_replace($this -> bot -> commpre "inspect"""$msg);
$itemlid  trim(preg_replace($regex'\1'$words));
$itemhid  trim(preg_replace($regex'\2'$words));
$itemql   trim(preg_replace($regex'\3'$words));
$itemname trim(preg_replace($regex'\4'$words));

$iteminfo "Low ID: " $itemlid " / High ID: " $itemhid " - QL: " $itemql " - Result: ";

if (!empty($this -> idn[$itemlid]))
{
return $iteminfo $this -> idn[$itemlid];
}
else
{
return $iteminfo "Unknown item - not a Biomaterial.";
}
}
}
?>


Thanks,
BubbaG
« Last Edit: December 11, 2005, 08:22:43 pm by Bubbagrunt »

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: !inspect command -- please unhack?
« Reply #1 on: December 11, 2005, 09:17:39 pm »
As far as I can remember... !bio <bio-material> works just fine. I think it comes as bio.php

Don't know why you need an !inspect command too :P
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Bubbagrunt

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: !inspect command -- please unhack?
« Reply #2 on: December 11, 2005, 09:25:02 pm »
 :o

Long answer - Damn, didn't see that with the whole guild whining and screaming that I took away their bloody IGN bot (where the command is <pre>inspect).

Short answer - I failed to do my homework and test every command on the bot.

Thanks for the help,
BubbaG

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: !inspect command -- please unhack?
« Reply #3 on: December 11, 2005, 09:29:56 pm »
Heheh, I was just going to mention that myself about the bio.php that comes with the bot.
Note: It's doesn't identify Gift packages. It should however not be to difficult to modify the exsisting one to Ident those as well.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Akarah

  • Contributor
  • *******
  • Posts: 72
  • Karma: +0/-0
    • http://synergyfactor.net/
Re: !inspect command -- please unhack?
« Reply #4 on: December 11, 2005, 09:46:51 pm »
you can just add $commands["gc"]["inspect"] to the bio.php and it should work.. i did this for mine (except my guild was used to !id so thats what i added.) and it worked :)

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: !inspect command -- please unhack?
« Reply #5 on: December 15, 2005, 02:17:52 am »
I made mine !clump :P

just change ['bio'] for ['inspect'] or whatever you want the command to be

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 443
  • 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