Home
About
Policies
FAQ
Forums
Registration
Password Recovery

User:WhiteWizard/Lua API

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
WhiteWizard (Talk | contribs)
(Created page with "This is a very quick definition of the (desired) API to access the Muck from Lua. ==Database== Almost all database access is done through a lua class. In the examples, '''d''' r...")
Newer edit →

Revision as of 23:11, 22 May 2013

This is a very quick definition of the (desired) API to access the Muck from Lua.

Database

Almost all database access is done through a lua class. In the examples, d refers to a dbref class instance.

  • string d:desc() - Return the description of the object.
  • nil d:set_desc(desc) - Set above.
  • string d:name() - Return the name of the object.
  • nil d:set_name(name, [password]) - Set the name. Password required for a player.
  • integer d:type() - Returns the type of the object. One of: dbref.THING, dbref.PLAYER, dbref.GARBAGE, dbref.EXIT, dbref.ROOM
  • bool d.is_(thing|player|garbage|exit|room)() - Returns true if it is of this type.
  • bool d:is_valid() - Is > 0 < dbtop and not GARBAGE
  • string d:(success}osuccess|fail|ofail|drop|odrop)() - Get success/osuccess/fail/ofail/drop/odrop message.
  • nil d:set_(success}osuccess|fail|ofail|drop|odrop)(string) - Set success/osuccess/fail/ofail/drop/odrop message.
Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox