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 02, 2008, 12:49:16 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Support for older versions > BeBot 0.3 support > Topic: bugs in 0.3.4
Pages: 1 2 [3] 4   Go Down
« previous next »
Print
Author Topic: bugs in 0.3.4  (Read 2370 times)
0 Members and 1 Guest are viewing this topic.
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: bugs in 0.3.4
« Reply #30 on: June 20, 2007, 11:01:46 AM »

Quote from: Alreadythere on June 20, 2007, 08:43:51 AM
If you want to keep them with bebot you'll have to set notify = 1.

Pfft, I know that.

Only happens on the raid portion of the roster, incidentally.
Logged
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 877



WWW
Re: bugs in 0.3.4
« Reply #31 on: June 20, 2007, 01:27:47 PM »

why have u changed !invite to !inviteuser and wat does !invite do now?
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: bugs in 0.3.4
« Reply #32 on: June 20, 2007, 01:34:24 PM »

Quote from: Chris96 on June 20, 2007, 01:27:47 PM
why have u changed !invite to !inviteuser and wat does !invite do now?

Yeah it bugs the crap out of me too. Smiley

/tell bot !invite - bot invites you if you're allowed to join the pgroup. Alias of !join.
/tell bot !invite <name> - bot invites <name> if person calling is allowed to invite.

I imagine the change is due to the access control system, but it also shows the main weakness of access control system. The security system is not without it's flaws as well. Smiley

Maybe at some point access control can be expansed for subcommands/command parameters...
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: bugs in 0.3.4
« Reply #33 on: June 20, 2007, 02:55:34 PM »

I ran into the same problem regarding !invite with vhabot aswell.
So I just made !invite only for inviting other people and !join only for getting an invite yourself.
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: bugs in 0.3.4
« Reply #34 on: June 20, 2007, 03:01:29 PM »

Quote from: Vhab on June 20, 2007, 02:55:34 PM
I ran into the same problem regarding !invite with vhabot aswell.
So I just made !invite only for inviting other people and !join only for getting an invite yourself.

I've made this modification to all my bots that use a private group as well.
Logged
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 877



WWW
Re: bugs in 0.3.4
« Reply #35 on: June 21, 2007, 01:50:09 PM »

Well i changed !invite to actualy Invite and got rid of !inviteuser now which works fine
i also tried moving some code from my Old privgroup to this new 1 for features such as faction restriction on !join and !invite

i get this error when trying to set a faction
Code:
Fatal error: Call to a member function on a non-object in /Sources/Bot.php on line 470

altho not finished this is how my privgroup is now
Code:
<?php
/*
* PrivGroup.php - Basic featureset for private group handeling (join/kick etc)
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005 Thomas J. Stens� and ShadowRealm Creations
*
* Developed by:
* - Blondengy (RK1)
* - Khalem (RK1)
*
* See Credits file for all aknowledgements.
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
*  USA
*
* File last changed at $LastChangedDate: 2007-06-08 11:26:40 +0200 (Fri, 08 Jun 2007) $
* Revision: $Id: PrivGroup.php 594 2007-06-08 09:26:40Z alreadythere $
*/


$privgroup = new PrivGroup($bot);

if (
$bot -> guildbot)
{
$joindef = "gc";
$leavedef = "gc";
}
else
{
$joindef = "pgmsg";
$leavedef = "none";
}
$longjoin = "Which chat channels should be notified about joins to the private chat channel?";
$longleave = "Which chat channels should be notified about leave to the private chat channel?";

$bot -> set -> create("PrivGroup", "EchoJoin", $joindef, $longjoin, "none;pgmsg;gc;both");
$bot -> set -> create("PrivGroup", "EchoLeave", $leavedef, $longleave, "none;pgmsg;gc;both");
$bot -> set -> create("PrivGroup", "JoinString", "#!NICKNAME!# (#!LEVEL!#/#!AT_ID!# #!FACTION!# #!PROFESSION!#, #!ORG!#) has joined #!BOTNAME!#", "Formating string for join notifications.", "", TRUE);
$bot -> set -> create("PrivGroup", "LeaveString", "#!NICKNAME!# has left #!BOTNAME!#", "Formating string for leave notifications.", "", TRUE);
$bot -> set -> create("PrivGroup", "Deactivated", FALSE, "Is joining the private chat deactived?");
$bot -> set -> create("PrivGroup", "DeactivatedText", "Private chatgroup is disabled!", "The text shown if the private chat cannot be joined.", "");

unset(
$longjoin);
unset(
$longleave);
unset(
$joindef);
unset(
$leavedef);

// Create sane default levels for the commands
$bot -> accesscontrol -> create("tell", "join", "GUEST");
$bot -> accesscontrol -> create("tell", "chat", "GUEST");
//$bot -> accesscontrol -> create("tell", "invite", "GUEST");
$bot -> accesscontrol -> create("tell", "leave", "ANONYMOUS");
$bot -> accesscontrol -> create("tell", "kick", "ANONYMOUS");
$bot -> accesscontrol -> create("tell", "invite", "LEADER");
$bot -> accesscontrol -> create("pgmsg", "invite", "LEADER");
$bot -> accesscontrol -> create("pgmsg", "leave", "ANONYMOUS");
$bot -> accesscontrol -> create("pgmsg", "kick", "ANONYMOUS");
$bot -> accesscontrol -> create("pgmsg", "kickuser", "LEADER");
$bot -> accesscontrol -> create("pgmsg", "kickall", "ADMIN");
$bot -> accesscontrol -> create("gc", "join", "MEMBER");
$bot -> accesscontrol -> create("gc", "invite", "ADMIN");
$bot -> accesscontrol -> create("gc", "kickuser", "ADMIN");
$bot -> accesscontrol -> create("gc", "kickall", "ADMIN");
$bot -> accesscontrol -> create("tell", "lock", "ADMIN");
$bot -> accesscontrol -> create("tell", "faction", "ADMIN");
$bot -> accesscontrol -> create("tell", "forceinvite", "ADMIN");
$bot -> accesscontrol -> create("tell", "maxplayers", "ADMIN");
$bot -> accesscontrol -> create("pgmsg", "lock", "ADMIN");
$bot -> accesscontrol -> create("pgmsg", "faction", "ADMIN");
$bot -> accesscontrol -> create("pgmsg", "forceinvite", "ADMIN");
$bot -> accesscontrol -> create("pgmsg", "maxplayers", "ADMIN");



$commands["tell"]["join"] = &$privgroup;
$commands["tell"]["chat"] = &$privgroup;
$commands["tell"]["leave"] = &$privgroup;
$commands["tell"]["kick"] = &$privgroup;
$commands["tell"]["invite"] = &$privgroup;
$commands["tell"]["invite"] = &$privgroup;
$commands["pgmsg"]["leave"] = &$privgroup;
$commands["pgmsg"]["invite"] = &$privgroup;
$commands["pgmsg"]["kick"] = &$privgroup;
$commands["pgmsg"]["kickuser"] = &$privgroup;
$commands["pgmsg"]["kickall"] = &$privgroup;
$commands["gc"]["join"] = &$privgroup;
$commands["gc"]["invite"] = &$privgroup;
$commands["gc"]["kickuser"] = &$privgroup;
$commands["gc"]["kickall"] = &$privgroup;
$commands['tell']['lock'] = &$PrivGroup;
$commands['tell']['faction'] = &$PrivGroup;
$commands['tell']['forceinvite'] = &$PrivGroup;
$commands['tell']['maxplayers'] = &$PrivGroup;
$commands['pgmsg']['lock'] = &$PrivGroup;
$commands['pgmsg']['faction'] = &$PrivGroup;
$commands['pgmsg']['forceinvite'] = &$PrivGroup;
$commands['pgmsg']['maxplayers'] = &$PrivGroup;



$commands["pgjoin"][] = &$privgroup;
$commands["pgleave"][] = &$privgroup;



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


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

$this -> help['description'] = 'Module to handle the privat group.';
$this -> help['command']['join']="Join the private group of the bot.";
$this -> help['command']['chat']="Join the private group of the bot.";
// $this -> help['command']['invite']="Join the private group of the bot.";
$this -> help['command']['leave'] = "Leave the private group of the bot.";
$this -> help['command']['kick'] = "Leave the private group of the bot.";
$this -> help['command']['invite <name>'] = "Invites the player <name> to the private group of the bot.";
$this -> help['command']['kickuser <name>'] = "Kicks player <name> from the private group of the bot.";
$this -> help['command']['kickall'] = "Completely empties the private group of the bot.";

$this -> faction = 'Clan';
$this -> mode = 'include';
$this -> lock = 'disabled';
$this -> maxplayers = '200';

}



/*
This gets called on a tell with the command
*/
function tell($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "join/i", $msg)
// || preg_match("/^" . $this -> bot -> commpre . "invite$/i", $msg)
|| preg_match("/^" . $this -> bot -> commpre . "chat/i", $msg))
{
if ($this -> bot -> settings["Privgroup"]["Deactivated"])
{
$this -> bot -> send_tell($name, $this -> bot -> settings["Privgroup"]["Deactivatedtext"]);
}
else
{
$this -> bot -> aoc -> privategroup_invite($name);
}
}
else if (preg_match("/^" . $this -> bot -> commpre . "leave/i", $msg)
|| preg_match("/^" . $this -> bot -> commpre . "kick$/i", $msg))
$this -> bot -> aoc -> privategroup_kick($name);
else if (preg_match("/^" . $this -> bot -> commpre . "invite (.+)$/i", $msg, $info))
{
if ($this -> bot -> settings["Privgroup"]["Deactivated"])
{
$this -> bot -> send_tell($name, $this -> bot -> settings["Privgroup"]["Deactivatedtext"]);
}
else
{
$this -> invite($name, "tell", $info[1]);
}
}
else if (preg_match('/^'.$this -> bot -> commpre.'lock/i', $msg, $info)) $c = $this -> lock($name);
else if (preg_match('/^'.$this -> bot -> commpre.'maxplayers *([-0-9]+)*/i', $msg, $info)) $c = isset($info['1']) ? $this -> max_players($name, $info['1']) : $this -> max_players($name, 'return');
else if (preg_match('/^'.$this -> bot -> commpre.'forceinvite (.+)$/i', $msg, $info)) $c = $this -> forceinvite($name, ucfirst($info['1']));
else if (preg_match('/^'.$this -> bot -> commpre.'faction exclude (.+)/i', $msg, $info)) $c = $this -> faction($name, 'exclude', ucfirst($info['1']));
else if (preg_match('/^'.$this -> bot -> commpre.'faction (.+)$/i', $msg, $info)) $c = $this -> faction($name, 'include', ucfirst($info['1']));
else $c =  $this -> bot -> send_help($name);
       
$c != '' ? $this -> bot -> send_tell($name, $c) : NULL;

}



/*
This gets called on a msg in the privgroup with the command
*/
function pgmsg($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "leave/i", $msg))
$this -> bot -> aoc -> privategroup_kick($name);
else if (preg_match("/^" . $this -> bot -> commpre . "kick$/i", $msg))
$this -> bot -> aoc -> privategroup_kick($name);
else if (preg_match("/^" . $this -> bot -> commpre . "invite (.+)$/i", $msg, $info))
$this -> invite($name, "pgmsg", $info[1]);
else if (preg_match("/^" . $this -> bot -> commpre . "kickuser (.+)$/i", $msg, $info))
$this -> bot -> aoc -> privategroup_kick($info[1]);
else if (preg_match("/^" . $this -> bot -> commpre . "kickall$/i", $msg))
$this -> kick_all($name);
else if (preg_match('/^'.$this -> bot -> commpre.'lock/i', $msg, $info)) $c = $this -> lock($name);
else if (preg_match('/^'.$this -> bot -> commpre.'maxplayers *([-0-9]+)*/i', $msg, $info)) $c = isset($info['1']) ? $this -> max_players($name, $info['1']) : $this -> max_players($name, 'return');
else if (preg_match('/^'.$this -> bot -> commpre.'forceinvite (.+)$/i', $msg, $info)) $c = $this -> forceinvite($name, ucfirst($info['1']));
else if (preg_match('/^'.$this -> bot -> commpre.'faction exclude (.+)/i', $msg, $info)) $c = $this -> faction($name, 'exclude', ucfirst($info['1']));
else if (preg_match('/^'.$this -> bot -> commpre.'faction (.+)$/i', $msg, $info)) $c = $this -> faction($name, 'include', ucfirst($info['1']));
$c != '' ? $this -> bot -> send_pgroup($c) : NULL;
}




/*
This gets called on a msg in the guildchat with the command
*/
function gc($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "join/i", $msg))
{
if ($this -> bot -> settings["Privgroup"]["Deactivated"])
{
$this -> bot -> send_gc($this -> bot -> settings["Privgroup"]["Deactivatedtext"]);
}
else
{
$this -> bot -> aoc -> privategroup_invite($name);
}
}
else if (preg_match("/^" . $this -> bot -> commpre . "invite (.+)$/i", $msg, $info))
{
if ($this -> bot -> settings["Privgroup"]["Deactivated"])
{
$this -> bot -> send_gc($this -> bot -> settings["Privgroup"]["Deactivatedtext"]);
}
else
{
$this -> invite($name, "gc", $info[1]);
}
}