blob: cf3946f29964b1dd18dd7e2ec63271036a84c07b [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001The lens object uses a stack to manipulate objects. Some commands push objects
2on the stack, some pop them again off the stack and use them for various
3purposes. There may be multiple commands on a single line, separated by
4spaces. The number of spaces between commands or between commands and
5arguments is not critical, i.e. there may also be two or more spaces.
6
7Notation:
8 <arg> : a sequence of characters which doesn't contain spaces or
9 dots. If it does, use "...", '...' or |...| to enclose
10 it.
11 <number>: an integer, positive or negative.
12 <filename>: same as <arg> (use quotes if it contains dots). May be
13 absolute (starting with /) relative to your home directory
14 (starting with ~/) or relative to somebody else's home
15 directory (starting with ~name/).
16 <function>: Name of an LPC-function.
17
18Commands:
19 pl <arg> : push player object with name <arg>.
20 lv <arg> : push living object with name <arg>.
21 me : push yourself.
22 here : push the location you are in.
23 ob <filename> : load & push the object denoted by <filename>.
24 <filename> : same as ob <filename> if it begins with / or ~.
25 new <filename> : clone & push the object denoted by <filename>.
26 Thereafter move it in your inventory.
27 creat <filename>: same as new, but don't move it into your inventory.
28 env : push the environment of the TOS.
29 .<number> : push the nth object in the inventory of the TOS.
30 .<arg> : push the object with id <arg> in the inventory
31 of the TOS.
32 = : display the TOS.
33 info : show detailed information about the TOS.
34 stk : show the entire stack.
35 clr : clear the entire stack.
36 dup : duplicate the topmost stack entry.
37 pop : discard the topmost stack entry.
38 swap : exchange the two topmost stack entries.
39 over : push the entry second from top.
40 @<number> : push the stack entry corresponding to the number.
41 The topmost one has number 0.
42 inv : show the inventory of the TOS.
43 cln : clean the inventory of the TOS. Players are not
44 destructed.
45 clnof <arg> : clean the inventory of the TOS of all objects with
46 id <arg>.
47 rec : perform the next inv, cln or clnof recursively.
48 norec : use this to turn of rec again if you are not going
49 to use one of inv, cln or clnof. inv, cln and clnof
50 turn off rec automatically after being used.
51 dest : destruct the TOS.
52 make : destruct the TOS, then rebuild it from the file.
53 Very useful when developing rooms.
54 mov : move the object denoted by the stack entry that is
55 second from top into the TOS.
56 [<function>] : call <function> in the TOS.
57 [<function> <arg1> ... <argn>]
58 : call <function> in the TOS. arguments are separated
59 by spaces. If the arguments themselves contain
60 spaces, enclose them by "...", '...' or |...|.
61 Use @<number> to supply objects on the stack
62 as arguments.
63 result : push the result of the function call if it is
64 an object.
65 desc : toggle whether short descriptions are shown when
66 displaying objects.
67 # : the contents of the stack will be restored after
68 performing the next command on the same line.
69 Since all commands which manipulate stack objects
70 except inv and = pop them, this might come in handy.
71 <<number> : used to push variable <number>. May range from
72 0 to 9.
73 ><number> : store the TOS in variable <number>.
74 vars : display all variables.
75
76The following two commands can only be used as the first command on a line.
77
78 ? : there are two usages for the ?-command. Followed
79 by text it will execute the commands in it.
80 Simply hitting ?<CR> will put you in interactive
81 mode. Leave this mode by typing .<CR>. Lines
82 typed in will be executed by the lens and the
83 stack shown afterwards.
84
85 grant : Two forms are possible:
86 'grant access to <name>' allows the player with
87 name <name> to use the lens.
88 'grant no access' denies the access to all players
89 below level 21.
90
91Examples:
92 me /room/church mo
93 : go to the church.
94 pl demos ob ~demos/workroom mo
95 : move the player demos to his workroom.
96 here make
97 : update and load the room you are in, keeping the inventory
98 untouched.
99 here dup rec cln make
100 : same, this time cleaning up before.
101 me.bag inv
102 : show the contents of the bag you have.
103 me."bag 2" inv
104 : same for the second bag.
105 me [short]
106 : shows your short description.
107 me [query_attack] result [stop_fight]
108 : pacify your opponent.
109 pl demos [attacked_by @0]
110 : make Demos attack himself.
111 lv troll pl demos [attacked_by @1]
112 : demos is attacked by a troll.
113 here.troll here.demos [attacked_by @1]
114 : same effect if they're both here.
115 new /obj/level_list
116 : get yourself a copy of the top ten list.
117 pl ereborn clnof flea
118 : help poor ereborn to get rid of those fleas.
119 pl demos env [long]
120 : show the room where demos is.
121 here rec inv pop
122 : show the inventory of your current location and clean
123 up the stack afterwards.
124 me #[set_str 20] #[set_dex 20] #[set_int 20] #[set_con 20]
125 : set all your stats to the maximum possible value.
126 me [set_title "the new wizard"]
127 : changes your title accordingly.
128 pl demos env >4
129 : store the room Demos is in in variable 4.
130 <4 [query_dest_dir]
131 : get it again and list the possible exits.
132 me rec inv .4 inv
133 : get a recursive listing of yourself, then a non-recursive
134 one of the 4th item in your inventory
135 me.4.1 info
136 : show some information of the first item within the fourth
137 item in your inventory.
138 Please note that when doing a rec inv all the necessary
139 information to find any object is displayed in front
140 of it.