File: stdmacros.pl

package info (click to toggle)
gmoo 0.5.6-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,412 kB
  • ctags: 2,213
  • sloc: ansic: 18,320; sh: 5,396; makefile: 385; perl: 205; sed: 93; tcl: 30
file content (46 lines) | stat: -rw-r--r-- 1,390 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Macros based on the widely used Tinyfugue versions (for MOO only ?)
# This file may be overwritten when a new version of gmoo is installed

CLIENT::register_macro("e",    "e_cb",  "Edit a something");
CLIENT::register_macro("ne",   "ne_cb", "Notedit something");
CLIENT::register_macro("de",   "de_cb", "Describe an object");
CLIENT::register_macro("me",   "me_cb", "Describe yuourself");
CLIENT::register_macro("he",   "he_cb", "Describe your current location");

CLIENT::register_macro("verb",  "verb_cb", "Show all verbs on an object");
CLIENT::register_macro("verbs", "verb_cb", "Show all verbs on an object");
CLIENT::register_macro("prop",  "prop_cb", "Show all props on an object");
CLIENT::register_macro("props", "prop_cb", "Show all props on an object");

sub get_word($$)  {
  my @list = split(/ /, @_[0]);
  return $list[@_[1]];
}

sub e_cb    ($$) {
  WORLD::writeln(@_[0], '@edit ' . @_[1]);
}

sub ne_cb   ($$) {
  WORLD::writeln(@_[0], '@notedit ' . @_[1]);
}

sub de_cb   ($$) {
  WORLD::writeln(@_[0], '@notedit ' . get_word(@_[1], 0) . ".description");
}

sub me_cb   ($$) {
  WORLD::writeln(@_[0], '@notedit me.description');
}

sub he_cb   ($$) {
  WORLD::writeln(@_[0], '@notedit here.description');
}

sub verb_cb ($$) {
  WORLD::writeln(@_[0], '@d ' . get_word(@_[1], 0) . ':' );
}

sub prop_cb ($$) {
  WORLD::writeln(@_[0], '@d ' . get_word(@_[1], 0) . '.' );
}