/loaded ulock.tf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Noose's Unbelievable Unlocker v1.1 ;; - Idea from Cremater ;; ;; What does it do: Attempts to unlock and open a door ;; with keys you've got with you. ;; ;; Usage: 'ulock' or 'ulock ' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Hooks /def -mregexp -h'send ^(ulock|ulock ([A-z]+))$' ulock = \ /ulock_getkeys%;\ /set ulock_testkey 0%;\ /if (%-1!~"") \ /set ulock_door %-1%;\ /else /unset ulock_door%;\ /endif%;\ /do_unlock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Macros /def ulock_putkeys = !put all key in bag of holding /def ulock_getkeys = !get all key from bag of holding /def do_unlock = \ /eval /test ++ulock_testkey%;\ /if (ulock_door=~"") !unlock door with key %ulock_testkey%;\ /else !unlock %ulock_door door with key %ulock_testkey%;\ /endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Trigs /def -mregexp -t'^(An|A) (.*) key doesn\'t fit!$' ulock_wrongkey = /do_unlock /def -aB -mregexp -t'^You don\'t have key ([0-9]+).$' ulock_nokey = /ulock_putkeys /def -aB -t'There\'s no * door here.' ulock_nodoor = /ulock_putkeys /def -aBCgreen -t'You unlock * door *.' ulock_unlocked = \ /ulock_putkeys%;\ /if (ulock_door=~"") !open door%;\ /else !open %ulock_door door%;\ /endif /def -aB -t'The * door leading * is open!' ulock_dooropen = /ulock_putkeys /def -aB -t'Which door do you mean?' ulock_whichdoor = /ulock_putkeys