Menu

adding a new command?

Help
Anonymous
2001-07-17
2012-09-14
  • Anonymous

    Anonymous - 2001-07-17

    How do I add a new "/" command? I've tried the follwoing but it does not work. Can someone help please?

    in
    \phpMyChat\chat\lib\commands.lib.php3
    i have added this to end of the Elseif statement:

    elseif (eregi("^\/roll$", $M))
    {
        include("./lib/commands/roll.cmd.php3");
    };

    I then created the following file in:
    phpMyChat\chat\lib\commands\roll.cmd.php3

    <?php

    // Roll the number using Rand() function
    // First seed the random number generator
    srand((double)microtime()*1000000);

    $Rolled_Number = Rand(1, 6);

    $M = $Rolled_Number;

    AddMessage($M, $T, $R, $U, $C, '');

    $IsCommand = true;
    $RefreshMessages = true;
    ?>

    When I get into phpMyChat, and i type /roll I get a dialog error box that says that is not a valid command!

    I am obviously missing something...anyone have any ideas!?

     
    • Anonymous

      Anonymous - 2001-07-18

      Ok, thanks to a response in the General Discussion fourm, I was able to figure out what I was doing wrong. Thanks for all your help! It's a great chat system!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.