& dbase & dbase system Rhysem@[M*U*S*H|SW2]'s DataBase System (DBASE.TCL), written in TCL. Copyright 1998-1999, Jonathan A. Booth (kamikaze@imsa.edu) Written for PennMUSH 1.7.2 pl24 with Trivian@M*U*S*H's TCL patch applied. See 'help dbase license' for licensing information. For the MUSH-based commands and functions, see: @dbase db_def() db_get() db_name() db_set() db_version() The DB System has the following informational topics; use 'help dbase ' to access help on them: license loading setup For more information on the internals of the commands, and the tcl script itself, see the comments in the script's code itself. & dbase license DataBase System non-profit license: * You may redistribute the DB code, provided that the code is unmodified and that the help files (specifically the copyright and license notices) are distributed along with the code. * There is no warranty (express or implied) on the DB code or help-files. If something breaks, you get to keep all the pieces. * You may use the code for free for an unlimited about of time and users provided that the license and copyright notice are retained and unmodified. * Any changes you make to the help-files or DB code should be resubmitted to the author in a timely manner. DB commercial license: * Please contact the author for commercial licensing information. See also: 'help dbase' & dbase loading & dbase load The following code will guarantee that the DB System will load into the master interpreter, if the mush is started fresh, or rebooted while running. This code /MUST/ be run as god. This code also assumes you put the db.tcl script into 'game/tcl/' Add the following commands to god's startup: @tcl/load/master tcl/db.tcl See also: 'help dbase' & dbase setup I suspect that the db system won't work out of the box as is on a TinyMUSH, but that it is PennMUSH only. If there is enough demand for a TinyMUSH version, I may make a port, but it will likely be slower and not as efficient, so I will not be making the script cross-compatible. Steps to follow: 0) Have your site admin install the help-file that came with this system in your game/txt/hlp directory, and rebuild the text files via a 'make' in game/txt. 1) Install Trivian's TCL patch (if you use PennMUSH). It and info about it can be found at: http://slicer.hive.no/tcl/ Make sure you apply the CommandLimitPatch to a TCL distribution and compile that or this code will possibly not work! 2) Test the TCL patch. Note that I will not be giving you help on installing/configuring/testing the TCL patch. 3) Copy the db.tcl script somewhere into your game directory, perhaps into a new directory you create called 'game/tcl'. 4) Have god add a @startup to them that loads the db.tcl script into the master interpreter. See 'help db loading' for code that will do that. 5) Read the help files on the DataBase System, create a small database, and test that it is working. If so, then you're done. Use the DB System for whatever else you need. See also: 'help dbase' & @dbase @dbase/ [][= @dbase/list @dbase/set /<"pretty" name>=/ The first form prints out a list of all the currently defined databases. The second form will create a new for use. The third form will list the entries in a . And the last form will add a name/key/default value triplet to the . Database names should obviously be unique. You should also be aware that a database's name is the name of the attribute it will use to store it's data, so it is suggested that you pick unique and descriptive database names. (eg: CHAR_DATA, ECON_DATA) Name/key value pairs should be unique within their database, but can be repeated among different databases. (useful for databases like CHAR_DATA, CHAR_DATA_MODIFIERS) This command is, obviously, restricted to wizards. See also: 'help dbase' & db_set() db_set(,,,) Sets as the value corresponding to in 's . will be translated into it's when the key/value pair are actually stored in 's attribute. To clear a entry in a database, simply pass an empty string to value, such as: db_set(#1,TWINK_DATABASE,God,) This function is, obviously, restricted to wizards. See also: 'help dbase' & db_get() db_get(,,) Returns the value of 'a . doesn't need to be the complete "pretty" name, just enough that it's a unique match (though the full "pretty" name, or better yet, the key itself is _marginally_ faster). If there is no entry in the database, then the default value that was set with @dbase/set will be returned. This function is, obviously, restricted to those who can see the attribute the database is stored in on . See also: 'help dbase' & db_def() db_def(,) Returns the default value for in . See also: 'help dbase' & db_name() db_name(,) Returns the full "pretty" name of in . can be partial, or it can be the key field. See also: 'help dbase' & db_version() db_version() Returns the version of the DataBase System that you have. This is primarially for the use of other systems to determine that they are compatible with the DataBase System you have loaded. See also: 'help dbase'