Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CmdTakeFrom(Command):
- """
- Usage:
- Take <item> from <container>
- Gets an item from the container, if it's in there.
- """
- key = "take"
- def parse(self):
- # get args into 2 variables
- words = self.args.split("from")
- self.item = words[0]
- self.container = words[1]
- item = self.item
- container = self.container
- caller = self.caller
- container = caller.search(object, location=caller) # Check if container is in the room.
- item = caller.search(object, location=container) # Check if the item is in the container.
- if container and item:
- container.obj.move_to(caller, quiet=True) #move the item to the caller inventory
- caller.msg("%s is in %s.") % item, container
- caller.location.msg_contents(f"{caller.name} takes {item} from {container}.")
- caller.msg(f"You get {item} from {container}.")
- else:
- caller.msg("That item isn't in there.")
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Could not find '<class 'object'>'.
- Could not find '<class 'object'>'.
- That item isn't in there.
- Command take has no defined `func()` - showing on-command variables:
- obj (<class 'typeclasses.characters.Character'>): God
- lockhandler (<class 'evennia.locks.lockhandler.LockHandler'>): cmd:all()
- caller (<class 'typeclasses.characters.Character'>): God
- cmdname (<class 'str'>): take
- raw_cmdname (<class 'str'>): take
- cmdstring (<class 'str'>): take
- args (<class 'str'>): muffin from basket
- cmdset (<class 'evennia.commands.cmdset.CmdSet'>): +editnpc, +npc, +npccreate, @buildshop, about, access, accounts, addcom, alias, allcom, ban, batchcode, batchcommands, boot, cboot, ccreate, cdesc, cdestroy, cemit, channels, charcreate, chardelete, chelp, clock, cmdsets, color, copy, cpattr, create, cwho, delcom, desc, destroy, dice, dig, drop, east, emit, examine, find, force, get, give, grapevine2chan, help, home, ic, inventory, irc2chan, ircstatus, link, lock, look, mudinfo, mvattr, mystats, name, nick, north, objects, ooc, open, option, page, password, perm, pose, public, py, quell, quit, reload, reset, rss2chan, say, script, scripts, server, service, sessions, set, setdesc, sethelp, sethome, shutdown, spawn, study, style, tag, take, tel, tickers, time, trade, tunnel, typeclass, unban, unlink, userpassword, wall, whisper, who, wipe
- session (<class 'evennia.server.serversession.ServerSession'>): God(#1)@1:2:7:.:0:.:0:.:1
- account (<class 'typeclasses.accounts.Account'>): God(account 1)
- raw_string (<class 'str'>): take muffin from basket
- cmdid (<class 'int'>): 1170
- item (<class 'str'>): muffin
- container (<class 'str'>): basket
- --------------------------------------------------
- take - Command variables from evennia:
- --------------------------------------------------
- name of cmd (self.key): take
- cmd aliases (self.aliases): []
- cmd locks (self.locks): cmd:all();
- help category (self.help_category): General
- object calling (self.caller): God
- object storing cmdset (self.obj): God
- command string given (self.cmdstring): take
- current cmdset (self.cmdset): ChannelCmdSet
- >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement