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: <pre>help will only show commands you can use  (Read 6286 times)

0 Members and 1 Guest are viewing this topic.

MatHack

  • Guest
<pre>help will only show commands you can use
« on: February 04, 2006, 06:45:57 pm »
Since I don't like having commands listed which a member can't use anyway, I decided to find out how to 'fix' that. (good way to get better known with the bot structure too).

Please note that it will just not show the commands, but if you ask direct help for it (<pre>help <pre>command), it will still show the help (this is intended).

Changes are done in core/BotHelp.php

Code: [Select]
<?php
function 
main_help($name)
{
$help "<font color=CCInfoHeadline>::::: HELP :::::</font>\n\n";



$help .= "<font color=CCInfoHeader>Commands usable in Tells:</font>\n";
if (!empty($this -> bot -> commands["tell"]))
{
ksort($this -> bot -> commands["tell"]);
foreach ($this -> bot -> commands["tell"] as $key => $val)
{
if ($this -> bot -> rightsmanagement -> check_rights($name$key"tell"))
$help .= "<a href='chatcmd:///tell <botname> <pre>help <pre>" .
$key "'><pre>" $key "</a> ";
}
}
$help .= "\n\n";


$help .= "<font color=CCInfoHeader>Commands usable in Privategroup:</font>\n";
if (!empty($this -> bot -> commands["pgmsg"]))
{
ksort($this -> bot -> commands["pgmsg"]);
foreach ($this -> bot -> commands["pgmsg"] as $key => $val)
{
if ($this -> bot -> rightsmanagement -> check_rights($name$key"pgmsg"))
$help .= "<a href='chatcmd:///tell <botname> <pre>help <pre>" .
$key "'><pre>" $key "</a> ";
}
}
$help .= "\n\n";

if ($this -> bot -> guildbot)
{
$help .= "<font color=CCInfoHeader>Commands usable in Guild Chat:</font>\n";
if (!empty($this -> bot -> commands["gc"]))
{
ksort($this -> bot -> commands["gc"]);
foreach ($this -> bot -> commands["gc"] as $key => $val)
{
if ($this -> bot -> rightsmanagement -> check_rights($name$key"gc"))
$help .= "<a href='chatcmd:///tell <botname> <pre>help <pre>" .
$key "'><pre>" $key "</a> ";
}
}
$help .= "\n\n";
}

$this -> bot -> send_tell($name$this -> bot -> make_blob("Help"$help));
}
?>
« Last Edit: February 04, 2006, 06:54:58 pm by MatHack »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: <pre>help will only show commands you can use
« Reply #1 on: February 06, 2006, 01:12:36 pm »
Nice idea!

Should remove some testing around by nosy people :)

 

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