Development > Module Requests
Auto invite when logon
Blondengy:
Thats an easy one.
This should work, just quickly whipped it together - no time to test it I'm afraid. :(
Just save it as AutoInv.php in your "modules" directory.
--- Code: ---<?
/*
* AutoInv.php - Module to auto invite members.
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004-2005 Jonas Jax
*
* Developed by Blondengy (RK1)
* Special thanks goes out to Khalem (RK1) for his support.
*/
/*
Add a "_" at the beginning of the file (_ClassName.php) if you do not want it to be loaded.
*/
$AutoInv = new AutoInv($bot);
$commands["buddy"][] = &$AutoInv;
/*
The Class itself...
*/
class AutoInv
{
var $bot;
/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function AutoInv (&$bot)
{
$this -> bot = &$bot;
}
/*
This gets called if a buddy logs on/off
*/
function buddy($name, $msg)
{
if ($this -> bot -> is_member($name) && ($msg == 1))
$this -> bot -> aoc -> privategroup_invite($name);
}
}
?>
--- End code ---
iriche:
--- Quote from: "Blondengy" ---Thats an easy one.
This should work, just quickly whipped it together - no time to test it I'm afraid. :(
Just save it as AutoInv.php in your "modules" directory.
--- Code: ---<?
/*
* AutoInv.php - Module to auto invite members.
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004-2005 Jonas Jax
*
* Developed by Blondengy (RK1)
* Special thanks goes out to Khalem (RK1) for his support.
*/
/*
Add a "_" at the beginning of the file (_ClassName.php) if you do not want it to be loaded.
*/
$AutoInv = new AutoInv($bot);
$commands["buddy"][] = &$AutoInv;
/*
The Class itself...
*/
class AutoInv
{
var $bot;
/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function AutoInv (&$bot)
{
$this -> bot = &$bot;
}
/*
This gets called if a buddy logs on/off
*/
function buddy($name, $msg)
{
if ($this -> bot -> is_member($name) && ($msg == 1))
$this -> bot -> aoc -> privategroup_invite($name);
}
}
?>
--- End code ---
--- End quote ---
Yeah, That will invite ALL memhers (it wilo not work so good in a guildbot) I was going to check if is_guest ($name) not sure if that command exists ;)
Oplink:
works great... thanks :)
Navigation
[0] Message Index
[*] Previous page
Go to full version