Skip to content

Instantly share code, notes, and snippets.

@lorecrafting
Created January 22, 2018 02:53
Show Gist options
  • Save lorecrafting/c3f2bd5405b57d081bfdd9f5eaf44e8a to your computer and use it in GitHub Desktop.
Save lorecrafting/c3f2bd5405b57d081bfdd9f5eaf44e8a to your computer and use it in GitHub Desktop.
class CmdLook(COMMAND_DEFAULT_CLASS):
"""
look at location or object
Usage:
look
look <obj>
look *<account>
Observes your location or objects in your vicinity.
"""
key = "look"
aliases = ["l", "ls"]
locks = "cmd:all()"
arg_regex = r"\s|$"
def func(self):
"""
Handle the looking.
"""
caller = self.caller
if not self.args:
target = caller.location
if not target:
caller.msg("You have no location to look at!")
return
else:
target = caller.search(self.args)
if not target:
return
self.msg(caller.at_look(target), {type: 'look'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment