home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
fish
/
disks
/
d1088.lha
/
Programs
/
DungeonMap
/
Rexx
/
DungeonDimensions.rexx
next >
Wrap
OS/2 REXX Batch file
|
1994-11-30
|
1KB
|
57 lines
/*
** This is a sample of the use of some of the DungeonMap Rexx commands.
**
** Find and display the high and low range of a Dungeon map.
*/
OPTIONS RESULTS
OPTIONS FAILAT 10
/* Find the first DungeonMap Rexx port name, and address commands to this name */
Ports = SHOW('P')
Pos = INDEX(Ports,"DungeonMap")
IF Pos = 0 THEN DO
SAY "DungeonMap has not been started."
EXIT 10
END
DungeonMap = WORD(SUBSTR(Ports,Pos),1)
ADDRESS VALUE DungeonMap
/* Get the maximum dimensions of the Dungeon */
INFO
PARSE VAR RESULT SavedInterlace SavedAutoCentre SavedPrintSize SavedMapFormat SavedMaxX SavedMaxY SavedChangeTo SavedItemEvent
/* Check for correct map format */
IF SavedMapFormat != 'Dungeon' THEN DO
SAY "This can only be used on a Dungeon type map."
EXIT 10
END
/* Determine the dimensions */
MaxX = 0
MaxY = 0
MinX = SavedMaxX
MinY = SavedMaxY
DO X = 1 TO SavedMaxX
DO Y = 1 TO SavedMaxY
WHATIS X Y 'Floor'
IF RESULT = 'Floor' THEN DO
MinX = MIN( MinX, X )
MinY = MIN( MinY, Y )
MaxX = MAX( MaxX, X )
MaxY = MAX( MaxY, Y )
END
END
END
/* Display the results */
SAY 'This dungeon has X range from 'MinX' to 'MaxX', and Y range from 'MinY' to 'MaxY