Aardwolf MUD Home Page Link

Location: Home / Lua Coding / Object Properties

Accessing Object Properties

Using 'ch' as an example which represents a character object in the MUD, accessing properties is as simple as using 'ch.level', 'ch.gold', 'ch.int', etc.

Example code may be:

if ch.level > 100 then
   send(ch,"You are a noble!")

if ch.int < self.int  --- remember, self is the mob running the prog.
   say("I'm smarter than you!")
   say("You're smarter than me!")

If you are dealing with an object, you may write something like

if obj.level < 100 then
   say ("I don't accept this low level junk!")
   mdo ("give " .. obj.name .. " " .. ch.name)

The line beginning 'mdo' is using Lua concatentation to create a command the character will execute in the MUD itself - in this case returning the object to the character that triggered the script.

Property Tables

CharactersTable of available character properties
ObjectsTable of available game item properties.
RoomsTable of available room and exit properties.
MudTable of available MUD properties.