Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. class CmdFEdit(default_cmds.MuxCommand):
  2.     """
  3.    Syntax: fedit <object>
  4.    
  5.    Loads an object description into your MUSH-compatible client's command
  6.    line for fast, easy editing. This should work with pretty much any MUSH
  7.    client, but some require that you create a trigger (TinyFugue, BeipMU,
  8.    MUSHclient, for example).
  9.    
  10.    """
  11.  
  12.     key = "fedit"
  13.     aliases = "fugueedit"
  14.     lock = "cmd:all()"
  15.     help_category = "General"
  16.  
  17.     def func(self):
  18.  
  19.         if not self.lhs:
  20.             self.caller.msg("Syntax: %s <object>" % self.cmdname)
  21.             return
  22.  
  23.         what = self.caller.search(self.lhs)
  24.  
  25.         # Just quit if we didn't find anything. The search will handle the error message.
  26.         if what:
  27.             # Make sure that the caller has permission to modify the object.
  28.             if not what.access(self.caller, "edit"):
  29.                 self.caller.msg("You don't have permission to modify the description of that object.")
  30.             else:
  31.                 if not what.attributes.has("desc"):
  32.                     self.caller.msg("There is no description set on that object.")
  33.                 else:
  34.                     desc = what.db.desc or ''   # just in case
  35.                     self.caller.msg("FugueEdit > @desc #%d=%s" % (what.id, desc), options={"raw" : True})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement