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

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

Author Topic: Login Message  (Read 3913 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Login Message
« on: December 16, 2005, 12:18:51 am »
This lets you set a message to send a bot member everytime he logs on

!loginmessage <message> (sets the message)
!loginmessage (clears the message)


modules/LoginMessage.php
Code: [Select]
<?
$loginMessage = new LoginMessage($bot);

$commands["tell"]["loginmessage"] = &$loginMessage;
$commands["pgmsg"]["loginmessage"] = &$loginMessage;
$commands["buddy"][] = &$loginMessage;


class LoginMessage
{
var $bot;
var $message;


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

function tell($name, $msg)
{
$this -> bot -> send_tell($name, $this -> processCommand($name, $msg));
}

function pgmsg($name, $msg)
{
$this -> bot -> send_pgroup($this -> processCommand($name, $msg));
}


function buddy($name, $msg)
{
if (($msg == 1) && ($this -> bot -> is_member($name) == 1) && (!empty($this -> message)))
$this -> bot -> send_tell($name, $this -> message);
}


function processCommand($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "loginmessage$/i", $msg))
{
if (!$this -> bot -> admin -> in_group($name, "leader") &&
!$this -> bot -> admin -> in_group($name, "raidleader") &&
!$this -> bot -> admin -> in_group($name, "admin") &&
!$this -> bot -> admin -> in_group($name, "superadmin")) {
return "You don't have permission to use this command.";
}
}
if (preg_match("/^" . $this -> bot -> commpre . "loginmessage$/i", $msg))
{
$this -> message = "";
return "Login message cleared.";
}
if (preg_match("/^" . $this -> bot -> commpre . "loginmessage (.+)$/i", $msg, $info))
{
$this -> message = $info[1];
return "Login message set.";
}
}
}
?>

 

* Recent Posts
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 ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 376
  • 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