@q
@program vsys-@vlookout
1 99999 d
i
( vsys-@vlookout v1.0 Jessy @ FurryMUCK 4/00
Part of the vsys vehicle system, this program handles display of
a vehicle's location to interior rooms.
INSTALLATION:
Port the program, set it Wizard and Link_OK. Create a global action
with a name such as '@vlookout', and link it to the program. Type
'<action name> #install'.
Vsys-@vlookout requires lib-vsys. See the header comment of lib-vsys
for more complete documentation of the vehicle system.
Vsys-@vlookout may be freely ported. Please comment any changes.
)
$include $lib/vsys
$define Tell me @ swap notify $enddef
lvar ourString
lvar ourVehicle
: DoInit ( -- ) (* ensure program is W and registered *)
(* create {vlookout} macro *)
LibInit
prog "W" flag? if
#0 "_reg/vsys/vlookout-prog" prog setprop
#0 "_reg/vsys/vlookout-com" trig setprop
#0 "_msgmacs/vlookout" "{muf:#$prog,}"
prog intostr "$prog" subst setprop
else
prog name " must be set Wizard." strcat me @ swap notify
pid kill
then
;
: DoInstall ( -- ) (* doesn't really do anything *)
DoInit
">> $prog installed." prog name "$prog" subst Tell
;
: DoHelp
" " Tell
prog name " (#" strcat prog intostr strcat ")" strcat Tell " " Tell
"This program displays vehicle locations to interior rooms." Tell
" " Tell
" $com ....................... Show vehicle location."
command @ "$com" subst Tell " " Tell
"The {vlookout} macro also calls this program. Include {vlookout} "
"in an object's desc to casuse looking at it to show the vehicle's "
"location. @vlookout and {vlookout} produce no result if you are "
"not currently in a vehicle." strcat strcat strcat Tell " " Tell
"For complete information on the vehicle system, type '@view $lib/vsys' "
"(long)." strcat Tell
;
: DoVlookout ( -- ) (* show current location *)
me @ GetVehicle dup if
ourVehicle !
me @ ShowLocation
then
;
: main
"me" match me !
DoInit
dup if
ourString !
then
ourString @ if
"#help" ourString @ stringpfx if DoHelp exit then
"#install" ourString @ stringpfx if DoInstall exit then
DoVlookout
else
DoVlookout
then
;
.
c
q