nightmare3_fluffos_v2/
nightmare3_fluffos_v2/bin/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/ChangeLog.old/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/Win32/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/simuls/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/clone/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/command/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/data/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/etc/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/master/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/log/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/compiler/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/efuns/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/operators/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/u/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/tmp/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/windows/
nightmare3_fluffos_v2/lib/cmds/ambassador/
nightmare3_fluffos_v2/lib/cmds/database/
nightmare3_fluffos_v2/lib/cmds/hm/
nightmare3_fluffos_v2/lib/cmds/soul/
nightmare3_fluffos_v2/lib/daemon/cfg/
nightmare3_fluffos_v2/lib/daemon/cfg/mon_races/
nightmare3_fluffos_v2/lib/daemon/cfg/races/
nightmare3_fluffos_v2/lib/daemon/include/
nightmare3_fluffos_v2/lib/daemon/save/
nightmare3_fluffos_v2/lib/daemon/services/
nightmare3_fluffos_v2/lib/daemon/soul/
nightmare3_fluffos_v2/lib/doc/
nightmare3_fluffos_v2/lib/doc/TestPlans/
nightmare3_fluffos_v2/lib/doc/approval/
nightmare3_fluffos_v2/lib/doc/approval/QC/
nightmare3_fluffos_v2/lib/doc/approval/balance/
nightmare3_fluffos_v2/lib/doc/build/
nightmare3_fluffos_v2/lib/doc/build/armours/
nightmare3_fluffos_v2/lib/doc/build/economy/
nightmare3_fluffos_v2/lib/doc/build/etc/
nightmare3_fluffos_v2/lib/doc/build/monster/
nightmare3_fluffos_v2/lib/doc/build/room/
nightmare3_fluffos_v2/lib/doc/build/virtual/
nightmare3_fluffos_v2/lib/doc/build/weapon/
nightmare3_fluffos_v2/lib/doc/classes/
nightmare3_fluffos_v2/lib/doc/efun/
nightmare3_fluffos_v2/lib/doc/etc/
nightmare3_fluffos_v2/lib/doc/help/creator/
nightmare3_fluffos_v2/lib/doc/help/hm/
nightmare3_fluffos_v2/lib/doc/law/
nightmare3_fluffos_v2/lib/doc/lpc/basic/
nightmare3_fluffos_v2/lib/doc/lpc/data_types/
nightmare3_fluffos_v2/lib/doc/lpc/etc/
nightmare3_fluffos_v2/lib/doc/lpc/intermediate/
nightmare3_fluffos_v2/lib/doc/lpc/types/
nightmare3_fluffos_v2/lib/doc/mudlib/
nightmare3_fluffos_v2/lib/doc/mudlib/features/
nightmare3_fluffos_v2/lib/domains/Examples/etc/
nightmare3_fluffos_v2/lib/domains/Examples/room/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaA/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaB/
nightmare3_fluffos_v2/lib/domains/Examples/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/
nightmare3_fluffos_v2/lib/domains/Praxis/adm/
nightmare3_fluffos_v2/lib/domains/Praxis/attic/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/mon/
nightmare3_fluffos_v2/lib/domains/Praxis/data/
nightmare3_fluffos_v2/lib/domains/Praxis/death/
nightmare3_fluffos_v2/lib/domains/Praxis/mountains/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/armour/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/magic/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/orc_valley/
nightmare3_fluffos_v2/lib/domains/Praxis/quests/
nightmare3_fluffos_v2/lib/domains/Praxis/standardOld/
nightmare3_fluffos_v2/lib/include/
nightmare3_fluffos_v2/lib/log/
nightmare3_fluffos_v2/lib/log/errors/
nightmare3_fluffos_v2/lib/log/reports/
nightmare3_fluffos_v2/lib/log/watch/
nightmare3_fluffos_v2/lib/news/
nightmare3_fluffos_v2/lib/secure/cfg/
nightmare3_fluffos_v2/lib/secure/cmds/ambassador/
nightmare3_fluffos_v2/lib/secure/cmds/mortal/
nightmare3_fluffos_v2/lib/secure/save/users/d/
nightmare3_fluffos_v2/lib/secure/std/
nightmare3_fluffos_v2/lib/std/hm/
nightmare3_fluffos_v2/lib/std/living/
nightmare3_fluffos_v2/lib/std/room/
nightmare3_fluffos_v2/lib/std/user/
nightmare3_fluffos_v2/lib/std/virtual/
nightmare3_fluffos_v2/lib/www/
nightmare3_fluffos_v2/lib/www/errors/
nightmare3_fluffos_v2/lib/www/gateways/
nightmare3_fluffos_v2/win32/
// File:        _refs.c
// Mudlib:      Nightmare (but see below)
// Purpose:     Lists refs set.
// Author:      Douglas Reay (Pallando @ TMI, Nightmare, many other muds ...
//                            want me on yours as well?  Mail me at TMI-2  8-)
// ***********  HISTORY OF THE REFS COMMANDS AND RELATED CODE  ***************
// Once upon a time, in a mud far from here (Genesis) Lars wrote a
// general purpose object tracer.  This was an object people cloned
// that added actions to them, including a simple call command.
// Many wizards copied this file, adding their own functions, some
// creating monstrosities many thousands of line long, consuming disc
// and memory resources.  The best of these was the scroll object tracer.
// 92-06-**   Pallando created a wiztool on Ephemeral Dales (a 2.* LPmud)
//            that kept the code for commands in seperate bins.
// 92-10-**   Wrote commands for the wiztool that did the same as the scroll
//            but allowed multiple references (which were kept as a associated
//            arrays in a daemon in the cmds bin).
// 93-01-02   Moved wiztool commands to TMI and converted to real user commands.
//            Users no longer need to clone an object to use call, etc.
//            refs kept in ob_data mapping in user
// 93-03-**   Work done on get_object() by Watcher@TMI (details in that file)
// 93-05-**   code copied to Nightmare.  refs kept in seperate mapping in user.
//            shared ref functions file moved to /adm/daemon/
// Mud where work done: Ephemeral Dales, TMI, Tabor, Nightmare, Actuator
// Simul_efuns:  identify(), resolv_str(), get_object(), get_objects()
// Commands: call cref dref eref move ref refs sc ss tref unref

#include <daemons.h>
#include <std.h>

inherit DAEMON;
inherit REFS_D;

int cmd_refs( string a )
{
  mapping refs;
  string *k;
  int i, s;

  refs = get_refs();
  if( !mapp(refs) || !(k=keys(refs)) || !(s=sizeof(k)) )
  {
    write( "You have no references set.\n" );
    return 1;
  }
  if( -1 != member_array( "default", k ) )
  {
    k -= ({ "default" });
    k = ({ "default" }) + k; // Make sure the default gets displayed first.
  }
  for( i = 0 ; i < s ; i++ )
    write( wrap( sprintf( "%-15s%s", k[i], identify( refs[k[i]] ) ) ) );
  return 1;
}

int help()
{
  write( @EndText
                    Help file on ref commands
                   ===========================

The commands in this directory allow you to do the things the scroll
object tracer does, but without a seperate object.  It also allows
you to set multiple references of any variable type and call functions
with any arguments.

  call <O>;<S>;<V>;<V>     calls function <S> in object <O> with args <V>
  ref [<S>;]<V>            sets reference <S> to variable <V>
  refs                     displays the references you have set
  unref <S>                unsets reference <S>
  eref [<S>;]<O>           sets reference <S> to the environment of <O>
  cref [<O>]               clones object <O>
  tref [<O>;]<S>           tells object <O> message <S>
  ss [<O>]                 scans the inventory of object <O>
  sc [<O>]                 recursively scans the inventory of object <O>
EndText
// Break needed because text too long for one block.
+ @EndText

Any of the arguments, except reference names, can be references.
A reference is specified by a "#" before the reference names.
Arguments given in [] are optional and will default.

NB  If you want to you can do

alias gref    move $* to me
alias summon  move $* to here
alias iref    call $*;query_id
alias all     call users;query;$*
EndText
  );
  return 1;
}