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: Tell Modul - Repeats a Msg Three Times  (Read 5566 times)

0 Members and 1 Guest are viewing this topic.

Offline Derroylo

  • Contributor
  • *******
  • Posts: 43
  • Karma: +0/-0
Tell Modul - Repeats a Msg Three Times
« on: May 29, 2005, 08:16:28 pm »
My first Script for this great bot :)

Description: It simply repeats the msg three times
Use :          !tell <msg>
Download:   Download Link

Code: [Select]

<?
$tell = new Tell($bot);

$commands["pgmsg"]["tell"] = &$tell;
$commands["gc"]["tell"] = &$tell;

/*
The Class itself...
*/
class Tell
{
var $bot;
    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Tell (&$bot)
{
$this -> bot = &$bot;
    }

    /*
      This gets called on a msg in the guildchat with the command
    */
    function gc($name, $msg)
    {
    if (preg_match("/^" . $this -> bot -> commpre . "tell (.+)$/i", $msg, $info)) {
    $this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
}
    }

    /*
      This gets called on a msg in the privgroup with the command
    */
    function pgmsg($name, $msg)
{
    if (preg_match("/^" . $this -> bot -> commpre . "tell (.+)$/i", $msg, $info)) {
    $this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
}
    }

    function send_tell($msg)
    {
      return "<font color=#9CC6E7>".$msg."</font>";
    }
}
?>
Derroylo 220/23 NT RK2

Offline Zarkingu

  • Contributor
  • *******
  • Posts: 34
  • Karma: +0/-0
Tell Modul - Repeats a Msg Three Times
« Reply #1 on: September 10, 2005, 05:58:04 pm »
Shouldn't this:

$commands["pgmsg"]["tell"] = &$time;
$commands["gc"]["tell"] = &$time;

be like this:

$commands["pgmsg"]["tell"] = &$tell;
$commands["gc"]["tell"] = &$tell;
Zarkingu 210 MP RK2

Offline Derroylo

  • Contributor
  • *******
  • Posts: 43
  • Karma: +0/-0
Tell Modul - Repeats a Msg Three Times
« Reply #2 on: September 10, 2005, 10:59:03 pm »
ehm yes ;)

corrected it and uploaded it again :)
Derroylo 220/23 NT RK2

 

* 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: 442
  • 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