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?
November 21, 2008, 08:18:58 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Experimental Rooster_GUILD.php
Pages: 1 2 [3] 4 5   Go Down
« previous next »
Print
Author Topic: Experimental Rooster_GUILD.php  (Read 8452 times)
0 Members and 1 Guest are viewing this topic.
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Experimental Rooster_GUILD.php
« Reply #30 on: May 08, 2006, 07:58:02 PM »

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-
Logged
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: Experimental Rooster_GUILD.php
« Reply #31 on: May 09, 2006, 06:33:24 AM »

Well thats a Autoinv.php function actually.

In Autoinv.php Change:
Code:
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:
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
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Experimental Rooster_GUILD.php
« Reply #32 on: May 09, 2006, 08:03:08 AM »

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-
Logged
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: Experimental Rooster_GUILD.php
« Reply #33 on: May 09, 2006, 08:30:44 PM »

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
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: Experimental Rooster_GUILD.php
« Reply #34 on: May 21, 2006, 06:20:10 AM »

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, 07:22:23 AM by Xenixa » Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Experimental Rooster_GUILD.php
« Reply #35 on: May 21, 2006, 01:46:33 PM »

Thanks Xenixa, sounds good :-D

-jj-
Logged
captainwinky
Rookie
**
Offline Offline

Posts: 31


Re: Experimental Rooster_GUILD.php
« Reply #36 on: May 21, 2006, 10:36:54 PM »

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 Smiley 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 Smiley
Logged
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: Experimental Rooster_GUILD.php
« Reply #37 on: May 22, 2006, 02: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. Smiley 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. Smiley

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 02, 2006, 07:09:34 PM by Xenixa » Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
captainwinky
Rookie
**
Offline Offline

Posts: 31


Re: Experimental Rooster_GUILD.php
« Reply #38 on: May 22, 2006, 05:47:29 AM »

ahh, oki.  thanks very much for info.  trying this now with v1.17.1 on BeBot_v0.2.2 Smiley


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, 06:07:06 AM by captainwinky » Logged
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: Experimental Rooster_GUILD.php
« Reply #39 on: May 22, 2006, 08:30:44 AM »

You may want to check on the function inc_gmsg()  in Bot.php. Does it look like this one?

Code:
/*
* 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]);
}
}
}
}
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
captainwinky
Rookie
**
Offline Offline

Posts: 31


Re: Experimental Rooster_GUILD.php
« Reply #40 on: May 22, 2006, 12:08:44 PM »

it's 3am and i'm tired, but i'm pretty sure it's identical  Undecided
Logged
Pharexys
Apprentice
***
Offline Offline

Posts: 94


Re: Experimental Rooster_GUILD.php
« Reply #41 on: June 19, 2006, 02: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:
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:
$this -> commands["buddy"][$key] -> buddy($user, $args[1]);

wich is nothing wrong.

The bug i think is here were i modified.

I changed :
Code:
// 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:
$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 Grin
« Last Edit: June 20, 2006, 12:59:04 AM by Pharexys » Logged
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Experimental Rooster_GUILD.php
« Reply #42 on: June 19, 2006, 06:35:20 AM »

The Class doesn't look to be closed, add a } at the end. (Before the ?> of course)
Logged

Eternalist
General of The Syndicate
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Experimental Rooster_GUILD.php
« Reply #43 on: June 19, 2006, 07:57:52 PM »

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-
Logged
Nesi
Rookie
**
Offline Offline

Posts: 55


Re: Experimental Rooster_GUILD.php
« Reply #44 on: June 20, 2006, 06:30:16 AM »

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.
Logged
Pages: 1 2 [3] 4 5   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Experimental Rooster_GUILD.php
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[Today at 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 16
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 10
Total: 11
upstart

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.287 seconds with 29 queries. (Pretty URLs adds 0.037s, 4q)
Loading...