BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: craized on December 02, 2005, 11:53:56 am
-
UPDATED PRIVGROUP (http://www.craized.net/junk/bebot/highlight.php?PrivGroup)
Description:
A module used to control all private group functions.
Features
!lock
Locks and unlocks bot invites.
!forceinvite <player>
Allows admins and raidleader to invite players through a lock and faction restrictions.
!faction <omni|neutral|clan|all>
Allows admins to set which faction will be allowed to enter the bot.
!faction exclude <omni|neutral|clan>
Allows admins to select a faction to be disallowed bot entry.
!leave
Leave the bot.
!kick
Leave the bot.
!kick <player> [reason]
Allows admins to kick a player with optional reason.
!join
Request bot invite.
!chat
Request bot invite.
!invite
Request bot invite.
!invite <player>
Invite other to bot.
-
*Rubs his eye's*
Nope not a Mirrage... that is a Craized posting something new. :)
-
Yea, I'm back for now. :) My org leader needed some bot tweaks and it got me back into it. I plan to be making more modules soon... Haven't wrote any help yet though. ><
-
hey shouldnt exclude
if($msg != 'All' || $mode != 'Exclude') {
be in lowercase? thats whats being passed here
else if (preg_match('/^'.$this -> bot -> commpre.'faction exclude (.+)/i', $msg, $info)) $c = $this -> faction($name, 'exclude', ucfirst($info['1']));
oh and it would be very nice if these settings could persist between reboots... if you are not doing that please let me know that Ill have to change mine
ps: guess I only need to change the initial variables
$this -> faction = 'All';
$this -> mode = 'include';
-
You're right, I'm glad you noticed. I'm updating it as soon as I finish debugging.
I've also tweaked this code. I've added a private group notification when someone tries to enter a locked bot.
Also yea, I don't like cluttering up databases for just a couple things, and I guess I did expect you to hard code in your default settings.
Glad to be back, thanks for the help.
-
also !leave by tells seems to be broken
np nice job
-
Thanks. Actually, I didn't want !leave or !lock to work in tells, so I've removed them from the command list.
-
Updated a lot of code, message syntax has changed, and everything works much better. Same link, as usual.
-
Error in line 90, in the function join.
-
In lines 90 and 97 a closing ")" is missing.
Should look like this:90: $this -> bot -> send_pgroup(count($this -> bot -> commands['pgmsg']['online'] -> pgroup));
97: $this -> bot -> send_pgroup($this -> highlight.$name.'</font> has attempted to join <botname>');
-
Thank you, updated.
-
Updated to use BANLIST MODULE (http://bebot.link/index.php/topic,287.0.html).
-
Parse error: parser error, unexpected '{' in /home/zubzero/BeBot_v0.2.2/modules/PrivGroup.php on line 70
Havent modified the file or anything.
Running php 4.4.1
-
Just an FYI, some syntax errors I found.
Line 70 needs an extra closing ) before the opening brace.
In line Line 72 ucfirst() is mispelled ucifrst()
Line 77 is missing a concatination period just after $this -> highlight.$who
Line 85 needs an extra closing ) before the opening brace.
-
Thanks, updated.
-
how do i make the !join free so they don't need to be on a guest list to join the guest channel?
-
You will need to move the !join command handler from the tell() to tell2() function is the easiest way to explain that.
-
sorry havent hade much time to make it on the bot befor now.
but can you plz tell me where to make the tell2() because i can't find it :(
-
Look in other modules...
-
i have tryed that now and i only get my bot to restart and say something about a line 368 in bot.php
i'm not so good at php yet. but working on it all i can
-
Changes to make to this module to get it working for everyone:
Find:
$privgroup = new PrivGroup($bot);
$commands['tell']['join'] = &$privgroup;
$commands['tell']['lock'] &$privgroup; <~~~~ Typo That Needs To Be Fixed
$commands['tell']['chat'] = &$privgroup;
$commands['tell']['leave'] = &$privgroup;
$commands['tell']['invite'] = &$privgroup;
After it Add:
$commands['tell2']['join'] = &$privgroup;
Then Find:
function tell($name, $msg) {
if (preg_match('/^'.$this -> bot -> commpre.'invite *([^ ]+)*$/i', $msg, $info)) $c = !isset($info['1']) ? $this -> join($name) : $this -> invite($name, ucfirst($info['1']));
else if (preg_match('/^'.$this -> bot -> commpre.'join$/i', $msg)) $c = $this -> join($name);
$c != '' ? $this -> bot -> send_tell($name, $c) : NULL;
}
And After Add:
function tell2($name, $msg) {
if (preg_match('/^'.$this -> bot -> commpre.'join$/i', $msg)) $c = $this -> join($name);
$c != '' ? $this -> bot -> send_tell($name, $c) : NULL;
}
That should give you the results you're looking for.
-
While I'm here tho, I was looking over the module and I noticed a few things that seemed alittle off to me. I apologize if anything I list is as it was intended, so please feel free to correct me if I'm wrong on any of these.
Line 12:
$commands['tell']['lock'] &$privgroup;
Should be:
$commands['tell']['lock'] = &$privgroup;
And on the /tell commands, it has listed that it reacts to 5 different commands via /tell, but only parses 2 of them. So shouldn't the /tell function look more like:
function tell($name, $msg) {
if (preg_match('/^'.$this -> bot -> commpre.'join$/i', $msg)) $c = $this -> join($name);
else if (preg_match('/^'.$this -> bot -> commpre.'lock$/i', $msg)) $c = $this -> lock($name);
else if (preg_match('/^'.$this -> bot -> commpre.'chat$/i', $msg)) $c = $this -> join($name);
else if (preg_match('/^'.$this -> bot -> commpre.'leave$/i', $msg)) $c = $this -> leave($name);
else if (preg_match('/^'.$this -> bot -> commpre.'invite *([^ ]+)*$/i', $msg, $info)) $c = !isset($info['1']) ? $this -> join($name) : $this -> invite($name, ucfirst($info['1']));
$c != '' ? $this -> bot -> send_tell($name, $c) : NULL;
}
And on the Join function:
function join($name) {
if(!$this -> bot -> commands['tell']['banlist'] -> bancheck($who)) {
Shouldn't it be:
function join($name) {
if(!$this -> bot -> commands['tell']['banlist'] -> bancheck($name)) {
If I'm wrong on any of those, I apologize, they just seemed alil off to me. :)
-
Wow... no wonders I code stuff myself :p
There was a ton of typos/errors in that module... Tsuyoi found most of them :P
-
thx Tsuyoi
now we don't have to have a guest of honor every day. the fix i made did something to the bot so i just took some random people and put them on the bot :-\
but it looks like you post helped me out there. so tyvm :)
-
[Bot] MyChar: !facion all
[Bot] Bot: Invites changed to >All faction by >MyChar.
[Bot] MyChar: !faction exclude Clan
[Bot] Bot: Invites changed to >Clan faction by >MyChar.
Ok, dont know, what is wrong here. Im not a big Coder.
-
[Bot] MyChar: !facion all
[Bot] Bot: Invites changed to >All faction by >MyChar.
[Bot] MyChar: !faction exclude Clan
[Bot] Bot: Invites changed to >Clan faction by >MyChar.
the fast way to do it (don't know if it's the only way) is to change
find:
$this -> faction = 'Clan';
$this -> mode = 'include';
$this -> lock = 'disabled';
$this -> maxplayers = '200';
change it to:
$this -> faction = 'Clan';
$this -> mode = 'exclude';
$this -> lock = 'disabled';
$this -> maxplayers = '200';
-
i get this error
Fatal error: Call to a member function on a non-object in (...site addy....)/modules/PrivGroup.php on line 170
Any 1 know why and how to fix or an alt module
main feature i like is the clan only invite thing as i run a bot for battle ship
the line in question reads
$this -> user = $this -> bot -> whois -> lookup($name);
-
You need the module here (http://bebot.link/index.php/topic,223.0.html).
-jj-
-
Works now thank you
-
I don't know if anyone is still getting anything from this thread, but fixed bugs posted by Tsuyoi