@prog recorder-control.muf 1 999 d i ( recorder-control.muf by Wog SETUP - @create Tape Player @action record;play;stop;erase;insert;eject=Tape Player @link record=# NOTE: If you want to prevent some things from being done they you need to remove aliases from the action name. GETTING A TAPE - @create Tape insert tape {You will be asked here if you want to make it a tape. Type yes} yes OPTIONAL SETUP - @set Tape Player=_prefix: --- Change History ---------------------------------- v 1.0 02/24/00 Assignment of version number to programs. --- Distrubution Information ------------------------ Copyright {C} Charles "Wog" Reiss This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or {at your option} any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GPL: a> see: http://www.gnu.org/copyleft/gpl.html b> write to: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ) $def RECORD_LISTENER prog "_listen_with" getprop lvar tape lvar device lvar prefix $include $lib/lmgr $def tell-all prefix @ swap strcat device @ location #-1 rot notify_except : doPlay device @ "_prefix" getpropstr dup not not if prefix ! else pop "[Recorded] " prefix ! then device @ "_play?" 1 setprop device @ "_tape" getprop tape ! 1 begin dup "_data" tape @ LMGR-getelem dup not if exit then dup "%:" stringpfx if 2 strcut swap pop atoi sleep else tell-all then device @ "_play?" getprop while 1 + repeat ; : main trig location device ! device @ thing? not if "Please attach the action to a thing." .tell exit then command @ dup "RECORD" instring if device @ "_play?" getprop if ">> Cannot record during playback!" .tell exit then device @ "_record?" getprop if ">> Already recording!" .tell exit then device @ "_tape" getprop ok? not if ">> INSERT tape first!" .tell exit then device @ "_record?" 1 setprop device @ "_tape" getprop "_last" systime setprop "You press the record button on the " device @ name strcat "." strcat .tell me @ name " presses the record button on the " strcat device @ name strcat "." strcat .otell device @ "_listen/recorder" RECORD_LISTENER setprop exit then dup "INSERT" instring if pop device @ "_tape" getprop ok? if ">> EJECT tape first!" .tell exit then me @ swap rmatch dup #-1 dbcmp not if "I don't see that here!" .tell exit then dup #-2 dbcmp not if "I don't know what you mean!" .tell exit then dup thing? not if "You can only put things in the tape player!" .tell exit then dup "_tape?" getpropstr .yes? not if "That's not marked as a tape. Should " over name strcat " be marked as a tape? (Y/n)" .tell read .no? not if dup "_tape?" "yes" setprop then then device @ "_tape" 3 pick setprop dup device @ moveto ( Put the tape inside our device... ) "You insert " over name strcat " into the " strcat device @ name strcat "." strcat .tell me @ name " inserts " strcat swap name strcat " into the " strcat device @ name strcat "." strcat .otell exit then dup "EJECT" instring if device @ "_play?" getprop if ">> Cannot eject tape during playback!" .tell exit then device @ "_record?" getprop if ">> Cannot eject tape while recording!" .tell exit then device @ "_tape" getprop ok? not if ">> There's no tape inside!" .tell exit then device @ "_tape" getprop dup me @ moveto device @ "_tape" #-1 setprop "You eject the " over name strcat " from the " strcat device @ name strcat ". " strcat .tell me @ name " ejects the " strcat swap name strcat " from the " strcat device @ name strcat "." strcat exit then dup "PLAY" instring if device @ "_tape" getprop ok? not if ">> Insert tape before playing!" .tell exit then device @ "_record?" getprop if ">> Cannot play tape while recording!" .tell exit then "You start the " device @ name strcat " playing." strcat .tell me @ name " makes the " strcat device @ name strcat " start playing." strcat .otell background doPlay device @ "_play?" getprop if " ** End of Tape ** " tell-all device @ "_play?" 0 setprop then exit then dup "STOP" instring if device @ "_play?" getprop if device @ "_play?" 0 setprop else device @ "_record?" getprop if device @ "_record?" 0 setprop device @ "_listen/recorder" remove_prop else exit then then "You press the stop button on the " device @ name strcat "." strcat .tell me @ name " presses the stop on the " strcat device @ name strcat "." strcat .otell then dup "ERASE" instring if device @ "_play?" getprop if ">> Cannot erase tape during playback!" .tell exit then device @ "_record?" getprop if ">> Cannot erase tape while recording!" .tell exit then device @ "_tape" getprop ok? not if ">> There's no tape inside!" .tell exit then "Erase tape? Are you sure?" .tell read .yes? if device @ "_tape" getprop "_data#" remove_prop "Tape wiped." .tell me @ name " erases the tape in the " device @ name strcat .otell then then ; . c q @prog recorder-listen.muf 1 999 d i ( recorder-listen.muf by Wog This program is part of the tape recorder system. It will record what it hears to the _data list of the item specified by the _tape prop on it's trigger. The _tape prop should be stored as a dbref, and the object it refers to must be set _tape?:yes Record format is as follows: %: