''' Command and command set for using a Keypad ''' from evennia import Command, CmdSet class CmdUseKeypad(Command): ''' Use a keypad Usage: use [the] keypad ''' key = 'use keypad' aliases = ['use the keypad', 'unlock'] def func(self): ''' Implement the command ''' # Have to yield here since Evennia only allows yield in command func keycode = yield('Enter keycode: ') self.obj.attempt_unlock(self.caller, keycode) class CmdSetKeypad(CmdSet): ''' Command set for using a keypad ''' key = 'cmdset_keypad' def at_cmdset_creation(self): 'Attach commands to the command set' self.add(CmdUseKeypad())