OSDN Git Service

upgrade to 3.6.1
[jnethack/source.git] / sys / vms / nethack.com
1 $! NetHack.Com -- sample command procedure for invoking NetHack  9-JAN-1993
2 $ v = 'f$verify(0)'
3 $!
4 $! $NHDT-Date: 1524689428 2018/04/25 20:50:28 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.5 $
5 $! Copyright (c) 2016 by Robert Patrick Rankin
6 $! NetHack may be freely redistributed.  See license for details.
7 $!
8 $!    Possible command line arguments include
9 $!      "-uConan-B"     !play a barbarian named Conan
10 $!      "-u" "Merlin-W" !play a wizard named Merlin (slight variant of above)
11 $!      "-e" or "-E"    !play an elf with default name (from environment
12 $!                      ! [ie, NETHACKOPTIONS logical name] or VMS username)
13 $!      "-a" or "-A", "-b" or "-B", "-c" or "-C", ... !specify character type
14 $!                      !note: "-s" is ambiguous between "play as a samurai"
15 $!                      !   vs "show scoreboard", so use "-S" for the former
16 $!      "-x" or "-X"    !play in 'explore' mode (practice for beginners)
17 $!      "-D"            !play in 'wizard' mode (for debugging, available only
18 $!                      ! to the username compiled into nethack.exe as WIZARD)
19 $!      "-dec"          !turn on DECgraphics mode (VT100 line drawing, done
20 $!                      ! automatically below if appropriate term attribs set)
21 $!      "-d" dir-path   !specify an alternate playground directory (not
22 $!                      ! recommended; define HACKDIR instead)
23 $!
24 $
25 $!
26 $! assume this command procedure has been placed in the playground directory;
27 $!       get its device:[directory]
28 $       hackdir = f$parse("_._;0",f$environ("PROCEDURE")) - "_._;0"
29 $!
30 $! hackdir should point to the 'playground' directory
31 $ if f$trnlnm("HACKDIR").eqs."" then  define hackdir 'hackdir'
32 $!
33 $! termcap is a text file defining terminal capabilities and escape sequences
34 $ if f$trnlnm("TERMCAP").eqs."" then  define termcap hackdir:termcap
35 $!
36 ! [ obsolete:  now handled within nethack itself ]
37 ! $! prior to VMS v6, the C Run-Time Library doesn't understand vt420 :-(
38 ! $       TT$_VT400_Series = 113
39 ! $ if f$getdvi("TT:","DEVTYPE").eq.TT$_VT400_Series -
40 !  .and. f$trnlnm("NETHACK_TERM").eqs."" then  define nethack_term "vt400"
41 $!
42 $! use the VT100 line drawing character set if possible
43 $ graphics = ""
44 $       usropt = f$trnlnm("NETHACKOPTIONS")
45 $       if usropt.eqs."" then  usropt = f$trnlnm("HACKOPTIONS")
46 $ if f$locate("DECG",f$edit(usropt,"UPCASE")) .ge. f$length(usropt) then -
47     if f$getdvi("TT:","TT_DECCRT") .and. f$getdvi("TT:","TT_ANSICRT") then -
48 $       graphics = " -dec"      !select DECgraphics mode by default
49 $!
50 $! get input from the terminal, not from this .com file
51 $ deassign sys$input
52 $!
53 $       nethack := $hackdir:nethack
54 $       if p1.nes."-s" .and. p1.nes."-s all" then -
55                 nethack = nethack + graphics
56 $ nethack "''p1'" "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" "''p7'" "''p8'"
57 $!