BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Plac3bo on January 10, 2006, 09:06:35 pm

Title: !guildrelay
Post by: Plac3bo on January 10, 2006, 09:06:35 pm
So.. we have a guild for our alts, and a main guild.. so ppl wanted guildrelay.
I was up for the challenge.. but alas.. I failed  :-\

So something is missing in the docs.
I understand that you do !guildrelay nameofbotinotherguild
in both guilds..
But I get spammed but I only listen to members in both bot windows..

So.. should we do like !guest nameofotherbot or something, should the other bot be on the ignore list in the conf?

I feel a updated help file on that would be appreciated.. and I still cant get it to work...
Title: Re: !guildrelay
Post by: Solerna on January 10, 2006, 09:43:45 pm
Yea that part is a bit dodgy, but I think I solved it by adding the other bot as a guest. "!guest otherbot" in both bots and It worked like a charm. Another good thing to do not entirely relevant but still. In the beta release of bebot there has been a minor change in bot.php I think in regards to how tells are handled and mainly reduced spam between bots. if u are going to use relay I'd really advice u to take a look at and do some changes in your bot.php if u are not already running the beta.
Title: Re: !guildrelay
Post by: kuznechik on January 12, 2006, 09:13:25 am
Btw, I know that some ppl was successful in guildrelaying and made online list of other-org available somehow.
How it was done? Problem is - bot aren't relaying blobs, so direct !online output to other-org bot won't work.
Title: Re: !guildrelay
Post by: Alreadythere on January 12, 2006, 10:53:41 am
I've done that by modifying the Rooster_GUILD to add both orgs to the members table, the buddy update does the rest.
Only works up to 1k total members in the orgs though.
Title: Re: !guildrelay
Post by: Solerna on January 13, 2006, 12:09:47 am
I did the same as "Alreadythere", and it does work ok, updates properly and so on. What you should be aware of is that this type of solution does not relay any sort of AFK status if that is present.
Title: Re: !guildrelay
Post by: jokerjr on January 24, 2006, 07:55:50 pm
Would you mind posting the code that you modified please.

thanks
Title: Re: !guildrelay
Post by: Tsuyoi on January 29, 2006, 08:19:02 am
How are the BeBot <-> IGN guildchat relay relations?
Title: Re: !guildrelay
Post by: Alreadythere on January 29, 2006, 12:33:23 pm
No clue what format IGN uses, you will have to adapt the output of bebot and the change the gcr command for incoming chat to whatever IGN uses.
Title: Re: !guildrelay
Post by: Tsuyoi on January 30, 2006, 04:15:34 am
Yea, I talked with Iriche last night and he said they currently don't communicate.  Spent a few hours perusing Amona's code to see exactly how much trouble it was going to be to see how she setup her relay.  After an hour or two of browsing her callback function I called it a night, sent her a PM to see if she would help me and logged off.  Hopefully with alittle bit more info I'll be able to create a Bebot module that models her method, which I hope will incorporate the relay syntax that helps out so much :)

Will be fun to attempt it anyways :)

- Tsuyoi
Title: Re: !guildrelay
Post by: Alreadythere on January 30, 2006, 01:34:30 pm
Would you mind posting the code that you modified please.
Here (http://www.m8y.de/ao/bebot/Rooster_GUILD.phps) is a version that should work.
It's not the version I'm using, as that doesn't do any updating in the bots anymore, only the handling of the buddy list is left there, but it's a combination of the code I use.

Edit the $relay_bot variable to fit your needs, and add the org IDs in the $orgid array. Should work with as many orgs as you want, as long as the total number of combined members is below 1k. No guarantee for any kind of working over 1k.
Title: Re: !guildrelay
Post by: jokerjr on January 30, 2006, 06:46:57 pm
Thank you Alreadythere
Title: Re: !guildrelay
Post by: Sylfarin on April 05, 2006, 01:05:46 am
Edit the $relay_bot variable to fit your needs

I got the orgID part, but what does one have to edit in the relay_bot part if you don't mind explaining?
Title: Re: !guildrelay
Post by: Alreadythere on April 05, 2006, 09:51:48 am
$relay_bot is for a two org setting, it takes the name of the second org bot so it doesn't get added to the members list. Nothing else.
Title: Re: !guildrelay
Post by: Sylfarin on April 06, 2006, 06:28:25 pm
I'm getting the same problem here, I cant seem to have both org bots communicate together, I did !guest botname, !relay (turned it on/off/on to double check) then did !guildrelay botname and still people cant read messages from the other org bot.
Is there anything else that one has to setup in order to be able to relay the org chat message? When I look down the console I can see that messages are sent to the other bot, let's say I get

[2006-04-06 16:23:07]   [TELL]  [OUT]   -> bot1: !gcr [orgname2] guildmember: blablabla
[2006-04-06 16:23:07]   [TELL]  [INC]   bot2: !gcr [org2name] guildmember: blablabla

I figure this means bots actually communicate, but nothing actually displays on other org chat, could anyone help me out on this one?
Title: Re: !guildrelay
Post by: Pharexys on April 07, 2006, 04:16:01 pm
I'm getting the same problem here, I cant seem to have both org bots communicate together, I did !guest botname, !relay (turned it on/off/on to double check) then did !guildrelay botname and still people cant read messages from the other org bot.
Is there anything else that one has to setup in order to be able to relay the org chat message? When I look down the console I can see that messages are sent to the other bot, let's say I get

[2006-04-06 16:23:07]   [TELL]  [OUT]   -> bot1: !gcr [orgname2] guildmember: blablabla
[2006-04-06 16:23:07]   [TELL]  [INC]   bot2: !gcr [org2name] guildmember: blablabla

I figure this means bots actually communicate, but nothing actually displays on other org chat, could anyone help me out on this one?

I got same problem with bebot,
I heard you need to get em on same IRC channel, you can find here (http://bebot.link/index.php/topic,155.msg664/topicseen.html#msg664) commands and info.. even though the download is not valid anymore. However i see any version of bebot or at least last one that i have downloaded from this web, had the irc modules already. However I cant get him join any channel w/e i do... so GL if you solve it let me know, I already gived up and using a modified IGN til i can find out how to link 2 bebots :P
Title: Re: !guildrelay
Post by: Naturalistic on April 07, 2006, 04:55:59 pm
No, they don't have to be in the same irc channel. The relay works, you just need to make sure it's setup properly and that both boths are members on each others databases to use the !gcr function. (Might need a little fiddling with :P)
Title: Re: !guildrelay
Post by: Pharexys on April 10, 2006, 04:00:25 pm
I made it work sylf, if u need help gimme a tell ingame :P
Title: Re: !guildrelay
Post by: Pharexys on May 14, 2006, 05:36:59 pm
Would you mind posting the code that you modified please.
Here (http://www.m8y.de/ao/bebot/Rooster_GUILD.phps) is a version that should work.
It's not the version I'm using, as that doesn't do any updating in the bots anymore, only the handling of the buddy list is left there, but it's a combination of the code I use.

Edit the $relay_bot variable to fit your needs, and add the org IDs in the $orgid array. Should work with as many orgs as you want, as long as the total number of combined members is below 1k. No guarantee for any kind of working over 1k.


O tryd this rooster, edited evrything.
But i get this error:

Code: [Select]
[2006-05-14 15:31:41]   [ROOSTER]       [UPDATE]        Starting rooster update

Fatal error: Call to a member function get_tablename() on a non-object in C:\bebot3.2\bebot\modules\Rooster_GUILD.php on line 85
Connected to MySQL
MySQL error (# 0) on query: ALTER TABLE admin_groups ADD description VARCHAR(80)
Duplicate column name 'description'
MySQL error (# 1) on query: ALTER TABLE admin_groups ADD short VARCHAR(5)
Duplicate column name 'short'

after this bot restart.
Anyone know what i wrong? What i am trying is to get 2 guilds on same !online list.
Edited Rooster a bit, but still get tons of errors, cant see what i wrong

edit: This is line 85 from rooster

Code: [Select]
// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " . $$this -> bot -> get_tablename("members"));
Title: Re: !guildrelay
Post by: Alreadythere on May 14, 2006, 05:44:27 pm
Put the following code into Bot.php:
Code: [Select]
function get_tablename($table) { return $table; }
I'm using that function to use a bot-specific prefix for my tablenames.
Title: Re: !guildrelay
Post by: Pharexys on May 14, 2006, 06:04:32 pm
Put the following code into Bot.php:
Code: [Select]
function get_tablename($table) { return $table; }
I'm using that function to use a bot-specific prefix for my tablenames.

Already had it in bot.php coz im using ur modules,
:( dunno what the f*** it has.
Title: Re: !guildrelay
Post by: Khalem on May 14, 2006, 06:41:52 pm
Wild guess
Code: [Select]
// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " . $$this -> bot -> get_tablename("members"));

Should probably be:
Code: [Select]
// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " . $this -> bot -> get_tablename("members"));
Title: Re: !guildrelay
Post by: Pharexys on May 14, 2006, 07:10:09 pm
Wild guess
Code: [Select]
// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " . $$this -> bot -> get_tablename("members"));

Should probably be:
Code: [Select]
// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " . $this -> bot -> get_tablename("members"));

i tryd this before but tryd it again, and i get this:

Code: [Select]
[2006-05-14 17:01:15]   [ROOSTER]       [UPDATE]        Starting rooster update
MySQL error (# 0) on query: INSERT INTO  (id, nickname, firstname, lastname, rank, rank_name, level, profession, gender, breed, ai_rank_id, ai_rank, p
ic, lvlrange) VALUES ('749693768', 'Pharexys', '', '', '0', 'President', '220', 'Adventurer', 'Male', 'Solitus', '22',  'Challenger', 'http://www.anar
chy-online.com/character/photos/40705.jpg', '215-220')

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id, nickname,
firstname, lastname, rank, rank_name, level, profession, gender, ' at line 1
Threshold of 10 errors in 30 seconds reached. Supressing error output for 30 seconds

Warning: Invalid argument supplied for foreach() in C:\bebot3.2\1\bebot\modules\Rooster_GUILD.php on line 139
[2006-05-14 17:01:32]   [ROOSTER]       [UPDATE]        Rooster update complete. Added 0 members, removed 0.
[2006-05-14 17:01:32]   [GROUP] [MSG]   [Devil Inside] Devilbot1: Bot is online :: System Ready


Line 139 from Rooster looks like this:
Code: [Select]
foreach ($memberlist as $currentmember)
wich is good imo, nothing wrong... well dunno what it has, i tryd to run it on a blank database, same stuff.
Probly someone already has 2 guilds that sharing the !online(member list) ?
Title: Re: !guildrelay
Post by: Khalem on May 14, 2006, 08:26:05 pm
Looks like your Roster module is missing parts of a modification done to it in regards to table names.
Fixing the error i pointed out should be done, it has merely revealed another problem with the module.
Title: Re: !guildrelay
Post by: Alreadythere on May 14, 2006, 09:47:35 pm
Make sure that the colums that are used in the insert command exist in the members table, otherwise you can remove unused columns.
Title: Re: !guildrelay
Post by: Pharexys on May 15, 2006, 12:52:58 am
Ok I couldnt edit ur Rooster Already, im not a coder or hacker or anything, atleast on php.
So i made 2 Roosters, redefineted em, also removed the function to rem buddys, and i run em 1 by 1,
I think i will make a script to run em evry 2 days or something, i know its not the "clean solve" but atleast works for me...
anyway i would still like to get 1 rooster for 2 guilds done, but till i got some time to spend on it, i'll work my way out with 2 roosters for my guilds.
If anyone want help on how to do it, I can even post the code here. Just ask i'll probly check this forums evry day since im workin on a raidbot now.
Title: Re: !guildrelay
Post by: Pharexys on May 21, 2006, 02:30:02 am
Code: [Select]
<?php
  
/*
   * Rooster.php - Handle member rooster
   *
   * BeBot - An Anarchy Online Chat Automaton
   * Copyright (C) 2004 Jonas Jax
   *
   * Developed by Blondengy (RK1)
   * Special thanks goes out to Khalem (RK1) for his support.
   *
   * File last changed at $LastChangedDate: 2004-12-29 01:41:32 +0100 (Wed, 29 Dec 2004) $
   * Revision: $Id: Rooster_GUILD.php 8 2004-12-29 00:41:32Z blondengy $
   *
   * Updated by Xenixa (RK1) to Include Alien Rank and Level.
   */


  /*
   Prepare MySQL database
  */
  
$db -> query("CREATE TABLE IF NOT EXISTS " $bot -> get_tablename("members") . "
              (id INT NOT NULL PRIMARY KEY,
              nickname VARCHAR(25),
              firstname VARCHAR(25),
              lastname VARCHAR(25),
              rank TINYINT,
              rank_name VARCHAR(20),
              level INT,
              profession VARCHAR(15),
              gender VARCHAR(10),
              breed VARCHAR(10),
              ai_rank_id INT,
              ai_rank VARCHAR(15),
              pic VARCHAR(100),
              lvlrange VARCHAR(10))"
);

  
$rooster = new Rooster($bot);

$commands["tell"]["member"] = &$rooster;
$commands["tell"]["members"] = &$rooster;
$commands["tell"]["memberlist"] = &$rooster;
$commands["gc"]["member"] = &$rooster;
$commands["gc"]["members"] = &$rooster;
$commands["gc"]["memberlist"] = &$rooster;
$commands["pgmsg"]["member"] = &$rooster;
$commands["pgmsg"]["members"] = &$rooster;
$commands["pgmsg"]["memberlist"] = &$rooster;


  
$cron["12hour"][] = &$rooster;



  
/*
    The Class itself...
  */
  
class Rooster
  
{
    var 
$bot;

    function 
Rooster (&$bot)
    {
$this -> bot = &$bot;
    }



    
/*
      This gets called on cron
    */
    
function cron()
    {
$this -> bot -> log("ROOSTER""UPDATE""Starting rooster update");

// Modify to fit your needs:
$relay_bot $this -> bot -> get_setting("relaybot");

// List of org ids this bot should keep as members:
// EDIT THOSE TO FIT YOUR NEED!
$orgids[0] = 01;
$orgids[1] = 02;

// Clean old member list before repopulating:
$this -> bot -> db -> query("TRUNCATE TABLE " $this -> bot -> get_tablename("members"));


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);

// Parse members
for ($i 1$i count($org); $i++)
{
$memb["nickname"] = $this -> bot -> xmlparse($org[$i], "nickname");
$memb["firstname"] = $this -> bot -> xmlparse($org[$i], "firstname");
$memb["lastname"] = $this -> bot -> xmlparse($org[$i], "lastname");
$memb["rank"] = $this -> bot -> xmlparse($org[$i], "rank");
$memb["rank_name"] = $this -> bot -> xmlparse($org[$i], "rank_name");
$memb["level"] = $this -> bot -> xmlparse($org[$i], "level");
$memb["profession"] = $this -> bot -> xmlparse($org[$i], "profession");
$memb["gender"] = $this -> bot -> xmlparse($org[$i], "gender");
$memb["breed"] = $this -> bot -> xmlparse($org[$i], "breed");
$memb["ai_rank_id"] = $this -> bot -> xmlparse($org[$i], "defender_rank_id");
$memb["ai_rank"] = $this -> bot -> xmlparse($org[$i], "defender_rank");
$memb["pic"] = $this -> bot -> xmlparse($org[$i], "photo_url");
$memb["id"] = $this -> bot -> aoc -> get_uid($memb["nickname"]);

if (($memb["level"] >= 1) && ($memb["level"] <= 99))
$memb["lvlrange"] = "1-99";
else if (($memb["level"] >= 100) && ($memb["level"] <= 149))
$memb["lvlrange"] = "100-149";
else if (($memb["level"] >= 150) && ($memb["level"] <= 199))
$memb["lvlrange"] = "150-199";
else if (($memb["level"] >= 200) && ($memb["level"] <= 214))
$memb["lvlrange"] = "200-214";
else if (($memb["level"] >= 215) && ($memb["level"] <= 220))
$memb["lvlrange"] = "215-220";
else
$memb["lvlrange"] = "unknown";

$this -> bot -> db -> query("INSERT INTO members (id, nickname, firstname,"
" lastname, rank, rank_name, level, profession, gender, breed, ai_rank_id, ai_rank, pic, lvlrange)"
" VALUES ('" $memb["id"] . "', '" $memb["nickname"] . "', '" $memb["firstname"] . "', '"
$memb["lastname"] . "', '" $memb["rank"] . "', '" $memb["rank_name"] . "', '" $memb["level"]
"', '" $memb["profession"] . "', '" $memb["gender"] . "', '" $memb["breed"] . "', '"
$memb["ai_rank_id"] . "',  '" $memb["ai_rank"] . "', '" $memb["pic"] . "', '" $memb["lvlrange"]
"')");
}
}

// get memberslist, and add all buddies in there:
$memberlist $this -> bot -> db -> select("SELECT * FROM " $this -> bot -> get_tablename("members"));

$buds $this -> bot -> aoc -> buddies;
$added 0;
$removed 0;

foreach ($memberlist as $currentmember)
{
$nickname $currentmember[1];
$id $currentmember[0];

if (ucfirst(strtolower($nickname)) != ucfirst(strtolower($this -> bot -> botname))
&& ucfirst(strtolower($nickname)) != ucfirst(strtolower($relay_bot)))
{
if (!$this -> bot -> aoc -> buddy_exists($id))
{
$this -> bot -> aoc -> buddy_add($id);
$this -> bot -> log("BUDDY""ADD"$this -> bot -> aoc -> get_uname($id));
$added++;
}
unset($buds[$id]);
}
}

        
$removed count($buds);

        
// Remove buddys not on list...
        
foreach ($buds as $id => $value)
        {
          
$this -> bot -> aoc -> buddy_remove($id);
          
$this -> bot -> log("BUDDY""DEL"$this -> bot -> aoc -> get_uname($id));
        }

$this -> bot -> log("ROOSTER""UPDATE""Rooster update complete. Added $added members, removed $removed.");
    }


/*
This gets called on a tell with the command
*/
function tell($name$msg)
{
if ($this -> bot -> admin -> in_group($name"admin"))
{
if (preg_match("/^" $this -> bot -> commpre "member del (.+)$/i"$msg$info))
$this -> bot -> send_tell($name$this -> member_del($name$info[1]));
else if (preg_match("/^" $this -> bot -> commpre "members$/i"$msg)
|| preg_match("/^" $this -> bot -> commpre "memberlist$/i"$msg))
$this -> bot -> send_tell($name$this -> member_list());
else if (preg_match("/^" $this -> bot -> commpre "member (.+)$/i"$msg$info))
$this -> bot -> send_tell($name$this -> member_add($name$info[1]));
}
else
$this -> bot -> send_tell($name"You must be an admin of this bot to use this command.");
}


/*
      This gets called on a msg in the guild chat with the command
    */
function gc($name$msg)
{
if ($this -> bot -> admin -> in_group($name"admin"))
{
if (preg_match("/^" $this -> bot -> commpre "member del (.+)$/i"$msg$info))
{
$this -> bot -> send_gc($this -> member_del($name$info[1]));
}
else if (preg_match("/^" $this -> bot -> commpre "notify on (.+)$/i"$msg$info))
$this -> notify_on($info[1]);
else if (preg_match("/^" $this -> bot -> commpre "notify off (.+)$/i"$msg$info))
$this -> notify_off($info[1]);
else if (preg_match("/^" $this -> bot -> commpre "members$/i"$msg)
|| preg_match("/^" $this -> bot -> commpre "memberlist$/i"$msg))
{
$this -> bot -> send_gc($this -> member_list());
}
else if (preg_match("/^" $this -> bot -> commpre "member (.+)$/i"$msg$info))
{
$this -> bot -> send_gc($this -> member_add($name$info[1]));
}
}
else
$this -> bot -> send_tell($name"You must be an admin of this bot to use this command.");
}

function pgmsg($name$msg)
{
if ($this -> bot -> admin -> in_group($name"admin"))
{
if (preg_match("/^" $this -> bot -> commpre "member del (.+)$/i"$msg$info))
{
$this -> bot -> send_pgroup($this -> member_del($name$info[1]));
}
else if (preg_match("/^" $this -> bot -> commpre "members$/i"$msg)
|| preg_match("/^" $this -> bot -> commpre "memberlist$/i"$msg))
{
$this -> bot -> send_pgroup($this -> member_list());
}
else if (preg_match("/^" $this -> bot -> commpre "member (.+)$/i"$msg$info))
{
$this -> bot -> send_pgroup($this -> member_add($name$info[1]));
}
}
else
$this -> bot -> send_tell($name"You must be an admin of this bot to use this command.");

}

function member_add($name$info)
{
$result $this -> bot -> db -> select("SELECT nickname FROM " $this -> bot -> get_tablename("members") . " WHERE id = "
$this -> bot -> aoc -> get_uid($info));

if (empty($result))
{
if (!$this -> bot -> aoc -> get_uid($info))
return "Player <font color=#FFFF00>" $info "</font> does not exist";
else
{
$member $this -> bot -> get_site("http://www.anarchy-online.com/character/bio/d/"
$this -> bot -> dimension "/name/" strtolower($info) . "/bio.xml");
$members["nickname"] = ucfirst(strtolower($info));
$members["firstname"] = $this -> bot -> xmlparse($member"firstname");
$members["lastname"] = $this -> bot -> xmlparse($member"lastname");
$members["rank"] = $this -> bot -> xmlparse($member"rank_id");
$members["rank_name"] = $this -> bot -> xmlparse($member"rank");
$members["level"] = $this -> bot -> xmlparse($member"level");
$members["profession"] = $this -> bot -> xmlparse($member"profession");
$members["gender"] = $this -> bot -> xmlparse($member"gender");
$members["ai_rank_id"] = $this -> bot -> xmlparse($member"defender_rank_id");
$members["ai_rank"] = $this -> bot -> xmlparse($member"defender_rank");
$members["breed"] = $this -> bot -> xmlparse($member"breed");
$members["pic"] = $this -> bot -> xmlparse($member"smallphoto_url");
$members["id"] = $this -> bot -> aoc -> get_uid($members["nickname"]);

if (($members["level"] >= 1) && ($members["level"] <= 99))
$members["lvlrange"] = "1-99";
else if (($members["level"] >= 100) && ($members["level"] <= 149))
$members["lvlrange"] = "100-149";
else if (($members["level"] >= 150) && ($members["level"] <= 199))
$members["lvlrange"] = "150-199";
else if (($members["level"] >= 200) && ($members["level"] <= 214))
$members["lvlrange"] = "200-214";
else if (($members["level"] >= 215) && ($members["level"] <= 220))
$members["lvlrange"] = "215-220";
else
$members["lvlrange"] = "unknown";

$this -> bot -> db -> query("INSERT INTO " $this -> bot -> get_tablename("members")
" (id, nickname, firstname, lastname, rank, rank_name, level, profession, gender, breed,"
" ai_rank_id, ai_rank, pic, lvlrange)
VALUES ('" 
$members["id"] . "',
'" 
$members["nickname"] . "', '" $members["firstname"] . "',
'" 
$members["lastname"] . "', '" $members["rank"] . "',
'" 
$members["rank_name"] . "', '" $members["level"] . "',
'" 
$members["profession"] . "', '" $members["gender"] . "',
'" 
$members["breed"] . "', '" $members["ai_rank_id"] . "',
'" 
$members["ai_rank"] . "', '" $members["pic"] . "',
'" 
$members["lvlrange"] . "')");

$this -> bot -> send_tell($info"<font color=#FFFF00>" $name "</font> has added you to <botname>'s roster.");
return "Player <font color=#FFFF00>" $info "</font> has been added to <botname>'s roster.";
}
}
else
return "<font color=#FFFF00>" $result[0][0] . "</font> is already on <botname>'s roster.";
}

function member_del($name$info)
{
$result $this -> bot -> db -> select("SELECT nickname FROM " $this -> bot -> get_tablename("members") . " WHERE id = "
$this -> bot -> aoc -> get_uid($info));
if (!empty($result))
{
$id $this -> bot -> aoc -> get_uid($info);
$this -> bot -> db -> query("DELETE FROM " $this -> bot -> get_tablename("members") . " WHERE id = " $id);
$this -> bot -> aoc -> buddy_remove($id);
return "<font color=#FFFF00>" $info "</font> has been removed from <botname>'s roster.";
}
else
return "<font color=#FFFF00>" $info "</font> is not on <botname>'s roster.";
}

function member_list()
{
$result $this -> bot -> db -> select("SELECT nickname FROM " $this -> bot -> get_tablename("members")
" ORDER BY nickname ASC");
$str $this -> bot -> colors -> get("white") . "Members of this bot:<br>"
$this -> bot -> colors -> get("lightgrey");;
$i 0;
foreach ($result as $mem)
{
$i++;
$str .= $mem[0] . "<br>";
}
return $this -> bot -> make_blob($this -> bot -> botname " has " $i " members!"$str);
}
}
?>



I made it work, you only need to edit org ids, and it should work now :P
Title: Re: !guildrelay
Post by: Sylfarin on June 06, 2006, 03:22:03 pm
First of all thanks for sharing this Phare, works like a charm.

I have a couple questions still though regarding the online function, where should I look in order to have the !online function to not display the bots themselves - it currently does as I am logged on chat server having a few tests.
Other problem I have with this is that when one logs on he gets tells from both bots displaying the number of online players.

Not that it's too big of a problem but that's a bit useless.  ;)

Anyways, thanks again for sharing this.
Title: Re: !guildrelay
Post by: Pharexys on June 06, 2006, 04:41:39 pm
Dunno how to remove em from member table,
Hm do you mean both bots says xxx logged on?
or they tell you how many members are online? kinda confused me here :P


If it show twice the player logon, simple put a _ infront of Logon_Guild.
(ps. do it on twink org, wont be able to set up !logon ;p)
Title: Re: !guildrelay
Post by: Sylfarin on June 06, 2006, 04:43:50 pm
My bad I got the login issue fixed, was the LogonNotify_GUILD.php file which I had to edit somewhat to fit my needs.

Still trying to figure out how to remove the bots from the online list without getting me into too much trouble.
Title: Re: !guildrelay
Post by: Alreadythere on June 06, 2006, 04:48:38 pm
Tried setting $relay_bot to the name of the second org bot?
That variable is supposed to fix your problem.
Title: Re: !guildrelay
Post by: Sylfarin on June 06, 2006, 05:39:34 pm
Tried setting $relay_bot to the name of the second org bot?
That variable is supposed to fix your problem.

$guild_relay_target = $this -> bot -> get_setting("Botname");

is what I have in my guildrelay file - using the beta version and there's no $relay_bot variable anywhere so I changed the name.
Did I invert where to put the Botname or?

EDIT: I tryed to put the botname into the $other_bots variable in the conf file, it works but as I thought this stops the relay between org chats - since the point of that variable is to prevent flood from raid bot to guild chat if I got it right.
Title: Re: !guildrelay
Post by: Pharexys on June 06, 2006, 06:02:48 pm
Tried setting $relay_bot to the name of the second org bot?
That variable is supposed to fix your problem.

doesnt work it looks like, tested it this mornig for sylf ;p
Title: Re: !guildrelay
Post by: Sylfarin on June 06, 2006, 06:36:34 pm
I'll try and dig into the original file and see what could be different, although as I posted on my previous answer when you add the name of relay bot into the $other_bot variable they dont display anymore when doing the online function - cant use it since it wont relay a word anymore but could be a hint.
Title: Re: !guildrelay
Post by: Alreadythere on June 06, 2006, 09:25:46 pm
Uhm - I mean the $relay_bot variable in the Rooster_GUILD.php. It's only used in the loop to build the buddy list of the bots.

Just edit the line to $relay_bot = "whateverthenameoftheotherbotis" ;)
Title: Re: !guildrelay
Post by: Sylfarin on June 08, 2006, 03:46:05 pm
Uhm - I mean the $relay_bot variable in the Rooster_GUILD.php. It's only used in the loop to build the buddy list of the bots.

Just edit the line to $relay_bot = "whateverthenameoftheotherbotis" ;)

My bad, I didn't read threw the whole code and thought $relay_bot would go and check into the conf file for the name of the relay bot itself.
I cant test it right now since I'm having a few other issues to fix but that should solve it.

Thanks a lot for you answer and your time Alreadythere.
SimplePortal 2.3.7 © 2008-2024, SimplePortal