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?
December 01, 2008, 02:13:50 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Improving relay over IRC
Pages: 1 [2]   Go Down
« previous next »
Print
Author Topic: Improving relay over IRC  (Read 1538 times)
0 Members and 1 Guest are viewing this topic.
Nytridr
Expert
*****
Offline Offline

Gender: Male
Posts: 261


WWW
Re: Improving relay over IRC
« Reply #15 on: May 05, 2007, 11:33:14 PM »

seems like privgroup isnt being relayed over the IRC channel and the IRC channel isnt being relayed to privgroup either..
Logged

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: Improving relay over IRC
« Reply #16 on: May 06, 2007, 02:02:52 AM »

i think that's located in the config now.
you should be able to turn it on/off
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Improving relay over IRC
« Reply #17 on: May 06, 2007, 03:30:25 AM »

Yes, it's a setting now, irc_chat. Default is gc.
Logged
Nytridr
Expert
*****
Offline Offline

Gender: Male
Posts: 261


WWW
Re: Improving relay over IRC
« Reply #18 on: May 06, 2007, 08:37:55 AM »

appreciate it.. for some reason I didnt see it when I was looking at the settings irc lastnight..
Logged

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)
Nytridr
Expert
*****
Offline Offline

Gender: Male
Posts: 261


WWW
Re: Improving relay over IRC
« Reply #19 on: May 06, 2007, 12:45:17 PM »

I am assuming this is in the IRC part of the bot.. since when I do not have the IRC mod going this dont happen..

the bot will build up using about 20+ megs of ram and just hang there..

Code:
[06-May-2007 10:48:49] PHP Fatal error:  Allowed memory size of 20971520 bytes exhausted (tried to allocate 8 bytes) in C:\aobots\RS\rsbot\Sources\MySQL.php on line 146

[06-May-2007 11:19:12] PHP Fatal error:  Allowed memory size of 20971520 bytes exhausted (tried to allocate 35 bytes) in C:\aobots\RS\rsbot\Sources\MySQL.php on line 164

[06-May-2007 11:31:53] PHP Fatal error:  Allowed memory size of 20971520 bytes exhausted (tried to allocate 96 bytes) in C:\aobots\RS\rsbot\Sources\MySQL.php on line 146

Now this didnt start happening till again till I turned on IRC Chat to both instead of GC.. 

Logged

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Improving relay over IRC
« Reply #20 on: May 06, 2007, 01:05:54 PM »

Uhm...

No clue, it shouldn't use more memory really...
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Improving relay over IRC
« Reply #21 on: May 06, 2007, 01:19:16 PM »

I've checked the code that I added, and besides a few instances of old settings names that I forgot to switch the only thing that could eat some memory is the regex checks. But the garbage collection should clean that up after the function calls are over...
Logged
Nytridr
Expert
*****
Offline Offline

Gender: Male
Posts: 261


WWW
Re: Improving relay over IRC
« Reply #22 on: May 06, 2007, 02:07:14 PM »

Quote from: Alreadythere on May 06, 2007, 01:19:16 PM
I've checked the code that I added, and besides a few instances of old settings names that I forgot to switch the only thing that could eat some memory is the regex checks. But the garbage collection should clean that up after the function calls are over...

IDK this is like a doctor problem.. when your at home you feel sick and think you need to go to the docs.. but when you get there you feel fine and the doc says theres nothing wrong..

well guess what.. mem is stable now and even though each bot is using differnt ram ammounts they are not going up and are staying pretty stable.. even though I have seen the bot still spamming off and on.. but I am woundering  if it has something to do with what ever is going on....  the differnt org bots are using between 5meg to 15megs right now.. all differnt.. not sure why either.
Logged

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)
Dabaron
Apprentice
***
Offline Offline

Gender: Male
Posts: 145


Re: Improving relay over IRC
« Reply #23 on: June 24, 2007, 05:30:44 PM »

I had added a few things to my IRC module in .2 but can't seem to get them working in .3.4 so thought I'd see what you guys think.  I'm sure its just something with the way .3.x handles stuff differently.  I changed the !online to show difference in org chat and private group and added a whois.

Code:
/*
* Gets called when someone does !online
*/
function irc_online(&$irc, &$data)
{
if (isset($this -> bot -> commands["tell"]["online"]))
{
foreach($this -> bot -> commands["tell"]["online"] -> guild as $player)
$nick[$player[0]] = 1;
ksort($nick);
$msg = count($nick) . " org members online: ";
foreach ($nick as $name => $val)
$msg .= $name . ", ";

foreach($this -> bot -> commands["tell"]["online"] -> pgroup as $guestplayer)
$guestnick[$guestplayer[0]] = 1;
ksort($guestnick);
$guestmsg = count($guestnick) . " players in guest channel: ";
foreach ($guestnick as $guestname => $val)
$guestmsg .= $guestname . ", ";


$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, $msg);
$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, $guestmsg);
}
else
$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, "Online module not installed.");
}

/*
        * Whois Function - Used exclusively for IRC to strip color codes and add IRC specific coding
        */
function whois_player($name)
{
$content = $this -> bot -> get_site("http://www.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml");
$who["nick"] = $this -> bot -> xmlparse($content, "nick");
$who["firstname"] = $this -> bot -> xmlparse($content, "firstname");
$who["lastname"] = $this -> bot -> xmlparse($content, "lastname");
$who["level"] = $this -> bot -> xmlparse($content, "level");
$who["gender"] = $this -> bot -> xmlparse($content, "gender");
$who["breed"] = $this -> bot -> xmlparse($content, "breed");
$who["profession"] = $this -> bot -> xmlparse($content, "profession");
$who["faction"] = $this -> bot -> xmlparse($content, "faction");
$who["rank"] = $this -> bot -> xmlparse($content, "rank");
$who["org"] = $this -> bot -> xmlparse($content, "organization_name");
$who["at_name"] = $this -> bot -> xmlparse($content, "defender_rank");
$who["at"] = $this -> bot -> xmlparse($content, "defender_rank_id");

if (!empty($who["nick"]))
{
$at = "(AT " . $who["at"] . " - " . $who["at_name"] . ") ";
$result = "\"" . $who["nick"] . "\"";
if (!empty($who["firstname"]) && ($who["firstname"] != "Unknown"))
$result = $who["firstname"] . " " . $result;
if (!empty($who["lastname"]) && ($who["lastname"] != "Unknown"))
$result .= " " . $who["lastname"];

$result .= " is a level " . $who["level"] . " " . $at . $who["gender"] . " " . $who["breed"] . " " . $who["profession"] . ", " . $who["faction"];
if (!empty($who["rank"]))
$result .= ", " . $who["rank"] . " of " . $who["org"] . ".";
else
$result .= ".";
}
else
$result = "www.anarchy-online.com was too slow to respond.";

return $result;
}

/*
* Gets called when someone does !whois
*/
function irc_whois(&$irc, &$data)
{
if (isset($this -> bot -> commands["tell"]["whois"]))
{
   preg_match("/^" . $this -> bot -> commpre . "whois (.+)$/i", $data -> message, $info);
                   $info[1] = ucfirst(strtolower($info[1]));

   if ($this -> bot -> aoc -> get_uid($info[1]))
      $this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, $this -> whois_player($info[1]));
                   else
       $this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, "Player " . $info[1] . " does not exist.");
}
else
    $this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> chan, "Whois module not installed.");
}
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Improving relay over IRC
« Reply #24 on: June 24, 2007, 05:42:10 PM »

Online no longer stores anything in arrays, so reading the online -> guild array won't work.

You have to query the online table, like the 0.3.4 version does.
Code:
$online = $this -> bot -> db -> select("SELECT nickname FROM #___online WHERE botname = '" . $this -> bot -> botname . "' AND status_gc = 1 ORDER BY nickname ASC");
The $online array contains the nicknames of all online buddies then.

Replace status_gc = 1 with status_pg to get charaters in private group.

For the whois you should call $this -> bot -> whois -> lookup($name), the whois cache is integrated in 0.3.4 already. Then just adapt your output generation to the slightly different array names used in the return, check core/Whois.php for a listing. It should work otherwise.
Logged
Dabaron
Apprentice
***
Offline Offline

Gender: Male
Posts: 145


Re: Improving relay over IRC
« Reply #25 on: June 24, 2007, 06:26:41 PM »

Thanks, I'll give that a try.
Logged
Pages: 1 [2]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Improving relay over IRC
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 21
Total: 22

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.391 seconds with 28 queries. (Pretty URLs adds 0.028s, 4q)
Loading...