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!?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!?
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!