eval.c

merentha_mudos_v1/lib/cmds/admin/eval.c · 679 B

From the archive merentha_mudos_v1.tar.gz

Download the archive   « Back to the archive contents

// Petrarch
// Merentha West

string help() {
return "Syntax: eval <commands>\n\nEvaluates the commands typed.\n\n\
Examples: eval 2+2\n\
          eval environment(find_player(\"petrarch\"))";
}

int command(string str) {
mixed o;
string file;
  if(!str) return notify_fail("Syntax: eval <command>\n");
  file="/realms/"+this_player()->query_name()+"/eval.c";
  rm(file);
  write_file(file, "mixed command() { return "+str+"; }");
  if(o=find_object(file)) o->remove();
  if(o=find_object(file)) destruct(o);
  o=file->command();
  message("command", ""+identify(o), this_player());
  if(o=find_object(file)) o->remove();
  if(o=find_object(file)) destruct(o);
  return 1;
}



Site Stats

Snippets: 1791
Codebases: 571