collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: guests and autoinvite  (Read 11309 times)

0 Members and 2 Guests are viewing this topic.

Offline Hyde

  • BeBot Apprentice
  • ***
  • Posts: 92
  • Karma: +0/-0
Re: guests and autoinvite
« Reply #15 on: August 22, 2007, 06:29:53 pm »
looking at the DB for Relaybot:

1) relaybot_settings
Members Autoinvite = TRUE
Members AutoinviteGroup = BOTH

2) relaybot_users
Aporg auto_invite = 1 ; user_level = 2
Goaorg auto_invite = 1 ; user_level = 2

Should something else need to be set to make Relaybot autoinvite Aporg and Goaorg?

If no, then I'll do a final confirmation (restarting Aporg and Goaorg again) just to be sure, but I don't believe I changed anything since the last restart last night and I had to do manual invites again last night.
Doctorhyde/Jexyll/Goraud@RK2

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: guests and autoinvite
« Reply #16 on: August 22, 2007, 06:35:20 pm »
Actually, thinking back I remember that even though I got the autoinvites working, if the bots got dropped they didn't always get autoinvited back (sometimes the org bot came online before the relay bot, sometimes the org bot would never recieve the invite for some reason, etc).

Try this little module.  It's a kludge, but it works for me.

Code: [Select]
<?php

$spam_autoinvites 
= new spam_autoinvites($bot);

$cron["5min"][] = &$spam_autoinvites;


class 
spam_autoinvites
{
var $bot;

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

/*
This gets called on cron
*/
function cron()
{
$members $this -> bot -> db -> select("SELECT nickname FROM #___users WHERE auto_invite = 1");
if(!empty($members))
foreach ($members as $member)
{
$this -> bot -> aoc -> privategroup_invite($member[0]);
echo "Inviting " $member[0] . " to the bot\n";
}
}

}
?>


Offline Hyde

  • BeBot Apprentice
  • ***
  • Posts: 92
  • Karma: +0/-0
Re: guests and autoinvite
« Reply #17 on: August 25, 2007, 08:05:41 pm »
Installed that script and it worked great ... except ... when I fixed the XML Roster it started inviting every person in the org :) (yeah, I know, the relay bot doesn't even need to be an org member, but I hadn't considered that earlier and I already had joined the bot ... in fact was kind of useful, as it FORCED me to disable alot of commands).

That become a REAL problem when it auto-invited everyone again 5 minutes later.

So I added a group called "RelayedBots", added the 2 bots to that group, and made some changes to the script so that it only spaminvites people in this group, and only if they're not already in the private group

Commands:
* !addgroup RelayedBots bots that we autoinvite
* !adduser {botname} RelayedBots

NOTE: The group doesn't need any extra permissions

Modifications to Ebag's Spaminvite.php:
* Invite only people in the RelayedBots group (could be made a setting probably)
* Don't invite people who are already in the guest channel

Code: [Select]
<?php
/*
   Modname: Spaminvites.php
   Purpose: Autoinvites relayed bots to the Relaybot.
   Details: See http://bebot.link/index.php/topic,947.0.html
   Authors: Ebagmp@RK2 & Doctorhyde@RK2
*/
$spam_autoinvites = new spam_autoinvites($bot);
$cron["5min"][] = &$spam_autoinvites;

class 
spam_autoinvites
{
        var 
$bot;
        function 
spam_autoinvites (&$bot) { $this -> bot = &$bot; }

        
// This gets called on cron
        
function cron() {
                
// look up the gid of the security_group "relayedbots"
                
$security_groups_gid $this -> bot -> db -> select("SELECT gid,name FROM #___security_groups WHERE name = \"RelayedBots\"");
                if(
$security_groups_gid[0][0]) {
                        
$relayedbots_gid $security_groups_gid[0][0];
                        
$thisbotname $this -> bot -> botname;
                        
$invitelist $this -> bot -> db -> select("SELECT ol.nickname,ol.status_pg,ol.botname,sm.gid,sm.name FROM online AS ol LEFT JOIN #___security_members AS sm ON ol.nickname = sm.name WHERE sm.gid = $relayedbots_gid AND ol.status_pg = 0 AND ol.botname = \"$thisbotname\"");
                        if (
$invitelist[0]) {
                                foreach (
$invitelist as $inviteme) {
                                        
$this -> bot -> aoc -> privategroup_invite($inviteme[0]);
                                        echo 
"... NOTICE: Inviting " $inviteme[0] . " to the bot\n";
                                }
                        }
                }
        }
}
?>
« Last Edit: August 27, 2007, 07:04:45 am by Hyde »
Doctorhyde/Jexyll/Goraud@RK2

Offline Hyde

  • BeBot Apprentice
  • ***
  • Posts: 92
  • Karma: +0/-0
Re: guests and autoinvite
« Reply #18 on: August 25, 2007, 08:29:18 pm »
(on the off chance someone downloaded the module above before I posted this note, fixed a bug ... added an if() so the invite would only happen if the inviteme array existed ... redownload if needed)

PS. If this gets incorporated into a Module it would seem to fit best in Relay_GUILD.php ... all of Relay_GUILD's settings currently seem to be focused on the client relays. Using this as the relay host setting would be useful. It would create "relayedbots" group and allow you to list all allowed clients.
« Last Edit: August 25, 2007, 09:18:28 pm by Hyde »
Doctorhyde/Jexyll/Goraud@RK2

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: guests and autoinvite
« Reply #19 on: August 27, 2007, 07:43:39 pm »
Added to trunk.

(Note the name change from Relay_Guild.php to Relay.php)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 200
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal