_localcmds.c

foundationI_fluffos_v1/lib/cmds/creator/_localcmds.c · 948 B

From the archive foundation1_fluffos_v1.zip

Download the archive   « Back to the archive contents

//      /bin/dev/_localcmds.c
//      from the Nightmare Mudlib
//      a command to check what commands are now available
//      created by Plura@Nightmare 9301??

#include <std.h>

inherit DAEMON;

int cmd_localcmds() {
    mixed *cmds;
    object ob;
    string result;
    int i, tmp;

    catch(cmds = (mixed *)this_player()->local_commands());
    if(!cmds || !sizeof(cmds)) {
        notify_fail("No commands available.\n");
        return 0;
   }
   result = file_name(cmds[0][2]) + ":\n";
   while(i<sizeof(cmds))
   {
      result += cmds[i][0] + " ";
      if((i++<(sizeof(cmds)-1)) && cmds[i-1][2] != cmds[i][2])
         result += "\n\n" + file_name(cmds[i][2]) + ":\n";
   }
    write(wrap(result, (tmp=(string)this_player()->getenv("LINES") ?
      to_int(tmp) : 75))+"\n");
   return 1;
}

int help()
{
  write( @EndText
Syntax: localcmd
Effect: Lists all commands added to you by objects
See also: from
EndText
  );
  return 1;
}

Site Stats

Snippets: 1791
Codebases: 571