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

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

Author Topic: Experimental Rooster_GUILD.php  (Read 32538 times)

0 Members and 2 Guests are viewing this topic.

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #30 on: May 09, 2006, 02:58:02 am »
Hi Xen,

Still using the files you posted back in January for notify and autoinvite.  I just wondered if it would be possible to add code so that it is possible for superadmin to turn off/on autoinvite for particular members (rather than each guest having to send bot a tell).

ie. !notify <name> <on/off>

I would add this to the !guestlist output so this can be manually changed easily from there (alongside Whois and Remove).

Cheers,

-jj-

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #31 on: May 09, 2006, 01:33:24 pm »
Well thats a Autoinv.php function actually.

In Autoinv.php Change:
Code: [Select]
function tell($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "autoinv (on|off)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> switchauto($name, $info[1]));
if (preg_match("/^" . $this -> bot -> commpre . "notify (on|off)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> notifymode($name, $info[1]));
else
$this -> bot -> send_help($name);
    }

To this:
Code: [Select]
function tell($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "autoinv (on|off)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> switchauto($name, $info[1]));
if (preg_match("/^" . $this -> bot -> commpre . "notify (on|off)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> notifymode($name, $info[1]));
elseif (preg_match("/^" . $this -> bot -> commpre . "notify (.+) (on|off)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> notifymode($info[1], $info[2]));
else
$this -> bot -> send_help($name);
    }

I didn't test that but it should work when you do !notify Name on|off
<<< Hack's in Zend Studio

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

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #32 on: May 09, 2006, 03:03:08 pm »
Thank you, first testing looks perfect!  If I can add into the !guestlist succesfully, I'll send you back :-)

BTW, this line doesn't need to be in GC function, correct?

         if (preg_match("/^" . $this -> bot -> commpre . "points transfer (on|off)$/i", $msg, $info))
            $this -> bot -> send_gc($this -> switchauto($name, $info[1]));

Many thanks for your quick feedback and hard work on this forum ;-)

Cheers,

-b-

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #33 on: May 10, 2006, 03:30:44 am »
The points transfer stuff is there for Bebot's ran as a raid bot. You can remove it if you want.
I myself just keep the command disabled using the commands module in v0.3.2

Oh btw, I've put yet a new version of Xens_Rooster_Guild.php on my FTP server. PHP5 is being a pain in my ass with a few things... most notibly order of evaluation concerning FOREACH loops and array's. Begining to think I should switch to the latest PHP5.1
<<< Hack's in Zend Studio

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

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #34 on: May 21, 2006, 01:20:10 pm »
My last and final update to this File is done.
See First post in this thread for more info.

Edit:
For those interested in how I came up with the fixes, here's the Cron Job step by step:
1.) Retrieve and build an array of the guild roster from FC servers
2.) Grab the Bots current buddylist and place it in an Array
3.) Insert/Replace the member records from the XML array with updated/new values into the Database
4.) Eval each Buddylist ID, Add only the new ID's to buddylist based on list from FC roster array.
5.) Remove each ID from buddylist array after it's eval'd. This leaves us with an Array of buddy ID's that are not Members
6.) Eval each remaining buddylist ID and remove the ID's that aren't on the Guest table.
7.) Delete characters from Member's Table if they match the current remaining ID in Buddylist array being evluated.

There it is. As plain and simple as I can get it. Blondengy had the right idea with this one originally btw, but the order of evaluation was all wrong. I had to pull up the original Cron job and read it step by step just to see what it was doing each step of the way. In it's basic form all I had to do was move the Insert/Replace to be before the buddylist stuff and add the guest table checks and member table deletions.

« Last Edit: May 21, 2006, 02:22:23 pm by Xenixa »
<<< Hack's in Zend Studio

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

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #35 on: May 21, 2006, 08:46:33 pm »
Thanks Xenixa, sounds good :-D

-jj-

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #36 on: May 22, 2006, 05:36:54 am »
currently running this on 0.2.2 with necessary changes to other BeBot files, except those related to AutoInv.php, Relay_GUILD.php, and WhoisCache.php (WhoisCache appears to require a little more in depth reading and learning on my part).

at this point it's working very nicely :) except for some of the functionality regarding [Org. Msg.].  upon a new member joining the org, Rooster_GUILD does not appear to add them to the bot, and a kicked member does not seem to invoke the applicable message in the guild-chat.  i was able to add the new member using the !member command, which seems strange as my understanding of your first post is that this was deemed redundant and therefore removed.

i am wondering if these, albeit somewhat minor, problems are a result of me not having correctly set up AutoInv.php, Relay_GUILD.php, and WhoisCache.php... or if they are not working for some other reason.

any help on this matter would be greatly appreciated :)

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #37 on: May 22, 2006, 09:26:30 am »
The [Org. Msg.] part will not work if your using an AOChat.php older than v1.19 or the custom v1.17.1 version I posted around here some where. I left the manual roster add/remove stuff for those occations that the bot may not witness a character leaving or joining org... like for example if the bot goes down. :) The redundancy part I wrote was about having redundant code in the module for each command types(tell, gc and pgmsg) hence it was consolidated into one function. Well two actually. :)

Also this version of Rooster_GUILD.php was written and tested on bebot 0.3.2, however I did have it working on 0.2.3 with the updated AOChat.php to handle FC's extended messages.
« Last Edit: September 03, 2006, 02:09:34 am by Xenixa »
<<< Hack's in Zend Studio

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

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #38 on: May 22, 2006, 12:47:29 pm »
ahh, oki.  thanks very much for info.  trying this now with v1.17.1 on BeBot_v0.2.2 :)


EDIT: hmm, no luck yet.  anyone have any information on whether the [Org. Msg.] functions can work on BeBot_v0.2.2?
« Last Edit: May 22, 2006, 01:07:06 pm by captainwinky »

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #39 on: May 22, 2006, 03:30:44 pm »
You may want to check on the function inc_gmsg()  in Bot.php. Does it look like this one?

Code: [Select]
/*
* Incoming group message (Guildchat, towers etc)
*/
function inc_gmsg($args)
{
$user = $this -> aoc -> get_uname($args[1]);

$found = false;

$group = $this -> aoc -> lookup_group($args[0]);

if (!$group)
{
$group = $this -> aoc -> get_gname($args[0]);
}

if($user == "0" && (substr($args[2], 0, 2) == "~&"))
{
$a_aoext = new AOExtMsg($args[2]);
$args[2] = $a_aoext -> text;
}
else
$args[2] = utf8_decode($args[2]);

if (preg_match("/<a type=chatclient version=(.+) href=(.+)>/isU", $args[2], $info))
{
if (isset($this -> commands["tell"]["online"]))
$this -> commands["tell"]["online"] -> chatclient ($user, $info[2]);
$args[2] = preg_replace("/<a type=chatclient version=(.+) href=(.+)><\/a>/isU", "", $args[2]);
}

if (isset($this -> commands["gmsg"][$group]) || ($group == $this -> guildname))
{
$this -> log("GROUP", "MSG", "[" . $group . "] " . $this -> aoc -> get_uname($args[1]) . ": " . $args[2]);
}

if (!isset($this -> other_bots[$user]))
{
if ($group == $this -> guildname)
{
if (!empty($this -> commands["gc"]))
{
$comms = array_keys($this -> commands["gc"]);
for ($i = 0; $i < count($comms); $i++)
{
if ($this -> is_command($comms[$i], $args[2]))
{
$this -> commands["gc"][$comms[$i]] -> gc ($user, $args[2]);
$i = count($comms);
$found = true;
}
}
}
}


if (isset($this -> commands["gmsg"][$group]) && !$found)
{
$comms = array_keys($this -> commands["gmsg"][$group]);
for ($i = 0; $i < count($comms); $i++)
{
$this -> commands["gmsg"]["$group"][$comms[$i]] -> gmsg($user, $group, $args[2]);
}
}
}
}
<<< Hack's in Zend Studio

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

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #40 on: May 22, 2006, 07:08:44 pm »
it's 3am and i'm tired, but i'm pretty sure it's identical  :-\

Offline Pharexys

  • BeBot Apprentice
  • ***
  • Posts: 117
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #41 on: June 19, 2006, 09:19:06 am »
Ok didnt worked how i wanted so deleted it,
I tryd to combine ur module with mine,
I get a error right now and that is :
Code: [Select]
Fatal error: Call to undefined method Rooster::buddy() in C:\bebot3.2\bebot\Bot.
php on line 464

The 464 line on bot.php is like this:
Code: [Select]
$this -> commands["buddy"][$key] -> buddy($user, $args[1]);
wich is nothing wrong.

The bug i think is here were i modified.

I changed :
Code: [Select]
// Get the guild roster
$org = $this -> bot -> get_site("http://community.anarchy-online.com/org/stats/d/" . $this -> bot -> dimension . "/name/" . $this -> bot -> guildid . "/basicstats.xml");
$org = explode("<member>", $org);

with this:
Code: [Select]
$orgids[0] = 5593094;
$orgids[1] = 4935681;
foreach ($orgids as $orgid)
{
$org = $this -> bot -> get_site("http://community.anarchy-online.com/org/stats/d/" . $this -> bot -> dimension . "/name/" . $orgid . "/basicstats.xml");
$org = explode("<member>", $org);

Any ideas what it has?


For more info my module is here:
http://devil-inside.org/modules/Rooster_Phar.phps
What i want is to combine this 2 roosters ;D
« Last Edit: June 20, 2006, 07:59:04 am by Pharexys »

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Experimental Rooster_GUILD.php
« Reply #42 on: June 19, 2006, 01:35:20 pm »
The Class doesn't look to be closed, add a } at the end. (Before the ?> of course)
Eternalist
General of The Syndicate

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #43 on: June 20, 2006, 02:57:52 am »
Xen,

Just added a new member to org, funnily enough didn't add to roster.  See extract from log:

[2006-06-20 00:46:13]   [GROUP] [MSG]   [Org. Msg.] 0: xxxxxx has joined your o
rganization.

Perhaps cause the relay is on?  Maybe the leading 0: is causing the problem?

Cheers,

-jj-

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Re: Experimental Rooster_GUILD.php
« Reply #44 on: June 20, 2006, 01:30:16 pm »
As this roster module depends on the messages delivered by AOChat.php it is suceptible to changes in these messages.
One such change was changing the "your organization" into "the organization" or the other way around... i forgot. Anyway, adding (?:the|your) in the preg_match reg.exp. should help compatability with newer/older AOChat versions.

 

* Recent Posts
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 ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

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