ARexx/JAH Remote Control of ScapeMaker2.0 Remember - ScapeMaker's Public Message Port has the name: SCAPEMAKER. All commands are in the form of: KEYWORD or KEYWORD ARGUMENT The single keywords allowed are: SAVE GRAB QUIT All the other keywords MUST be followed by 1 space (ASCII HEX $20, ' ') character, then the 'argument' of the keyword command. Here are the 'English-like' ARexx and JAH command keywords: PICPATH string (set picture file path, e.g. PICPATH "DF0:") PICNAME string (picture filename, e.g. PICNAME MYPICTURE) DEMPATH string (set DEM path name, also in quotes, e.g. DEMPATH "RAM:") DEMNAME string (set DEM filename, e.g. DEMNAME SCAPE) OPEN PIC (opens the named picture file) OPEN DEM (loads the named DEM file into 'active' DEM) ACTIVE LEFT (sets Left DEM as 'active') ACTIVE RIGHT (sets Right DEM as 'active') MODE VALUE (set mode for GRAB operations to COLOR VALUE) MODE NUMBER (set mode for GRAB operations to COLOR NUMBER) MODE EXTRUDE (set mode for GRAB operations to EXTRUDE - positive heights) MODE CARVE (set mode for GRAB operations to CARVE - negative depths) INSET ON (inset mode ON) INSET OFF (inset mode OFF SMX ON (smoothing in X direction) SMX OFF SMY ON (smoothing in Y direction) SMY OFF SMOOTH 1 (set smooth level to 1 and smooth) SMOOTH 2 (set smooth level to 2 and smooth) SMOOTH 3 (set smooth level to 3 and smooth) SMOOTH 4 (set smooth level to 4 and smooth) SMOOTH 5 (set smooth level to 5 and smooth) SETS 1-99 (e.g. SETS 20 - sets constant SCALE value S to 20) SCALE 1-99 (synonym for SETS command, same as in ScapeMaker 2.0) SETX 0-99 (e.g. SETX 10 - sets CONSTANT value X to 1000) MESA 0-99 (synonym for SETX command, same as in ScapeMaker 2.0) WIDTH value (width of grabber window) HEIGHT value (height of grabber window) LEFTEDGE value (distance of grabber window from left of image) TOPEDGE value (distance of grabber window from top of image) MAKE (make the DEM) GRAB (synonym of MAKE, same as in ScapeMaker 2.0) ADDDEM (ADDs inactive DEM to active DEM) SUBDEM (SUBtracts inactive DEM from active DEM) ADDX (ADDs constant value X to active DEM) SUBX (SUBtracts constant value X from active DEM) MULS (MULtiplies active DEM by constant value S) DIVS (DIVides active DEM by constant value S) CLEAR (CLEARs active DEM) SIZE 258 (sets DEM SIZE to 258x258 points - clears existing DEMs) SIZE 514 (sets DEM SIZE to 514x514 points - clears existing DEMs) SAVE (save the scape as named by DEMPATH and DEMNAME) QUIT (quit from the ScapeMaker program) The following functions are available only from ARexx/JAH scripts (they have no menu or keyboard or pushbutton alternatives): ANDDEM (logical AND inactive DEM with active DEM) ORDEM (logical OR inactive DEM with active DEM) EORDEM (logical EOR inactive DEM with active DEM) NEGDEM (arithmetic negative of active DEM) NOTDEM (logical NOT of active DEM) You'll find a REXXSCRIPT example of these commands and their formats. These commands also work with JAH (see JahScript for an example). ARexx Limit Checking, Error Checking, and Error Reporting All ARexx/Jah commands are limited to 64 characters in length. If you need to use long file names or paths, use ASSIGN commands before you start ScapeMaker. Remember, file paths longer than 79 characters are not allowed and file names longer than 30 characters are not allowed at all by ScapeMaker. The keywords are only checked to see if the first four letters match the templates above. For example, you can use PICP instead of PICPATH. Likewise, you can use PICPATHXXXXX instead of PICPATH if you really want to. Keywords which should be followed by an argument are parsed for EXACTLY ONE SPACE CHARACTER and then AT LEAST ONE ADDITIONAL CHARACTER. Also, there are specific limit checks and error checks on almost all the keywords which have arguments: 1. If the argument is a choice of ON or OFF, only those two exact choices will work (except you can make them longer, e.g. OFFXXXXX, if you really want to) 2. WIDTH and HEIGHT are limited to a range of 10 to (258 or 514) There is no check now to see if the HEIGHT value is greater than the picture's height. For example, you might load in a regular lo-res picture (320x200) and still set HEIGHT to 258. When you try to do the GRAB, however, you should get an error since ScapeMaker can't open a 258 high window on a 200 high screen! Besides - doesn't everyone use interlace ALL the time?? 3. LEFTEDGE and TOPEDGE will report an error if: LEFTEDGE + WIDTH > width of picture TOPEDGE + HEIGHT > height of picture YOU SHOULD LOAD AN IMAGE INTO ScapeMaker BEFORE YOU TRY TO SET LEFTEDGE OR TOPEDGE!! 4. S (SCALE) is limited to a range of 1 to 99. 5. X (MESA) is limited to a range of 0 to 99. 6. SMOOTH is limited to a range of 1 to 5. 7. MODE argument is checked so its first 4 characters match the possible modes: VALU... (for VALUE) NUMB... (for NUMBER) EXTR... (for EXTRUDE) CARV... (for CARVE) The ... means you can have anything following the checked choices, e.g. you can use VALUZRASG#@ if you want. 8. All numerical arguments are limited to ASCII numerals 0-9 and can be a maximum of 3 digits long. 9. OPEN checks to see if the first 3 letters of its argument are indeed either PIC or DEM. You could use OPEN PICSXsd if you wanted to. By convention (see the ARexx Manual by William Hawes), ScapeMaker returns a value to ARexx after every command. ARexx conventions are: 0 means no error 5 means tolerable error 10 means intolerable serious error ScapeMaker only returns two possible values to ARexx, 0 or 10. If an ARexx command to ScapeMaker succeeds, then ScapeMaker returns 0. If a command fails, then ScapeMaker always returns 10, since none of the errors you can get in ScapeMaker is really tolerable. Any ScapeMaker error means something really went wrong (e.g. you tried to smooth a scape before you even loaded a pic) and your ARexx script-program definitely is going to give you WRONG results. JAH is a CLI command I wrote a while back which lets you send a text message to a named message port, without using ARexx at all. If you don't have ARexx, you can use JAH (either as a CLI command or within an AmigaDos script) to control ScapeMaker. The JAH commands are just like the ARexx commands described above and there is a sample JAH script on this disk. You can also try the XecuteJAHScript. Just double-click on the icon and a JAH script (an AmigaDos script) will fire up ScapeMaker and run it by remote control. JAH doesn't have any error reporting at all. JAH is on this disk. It is copyrighted, so don't copy it and give it away. Thanks. Have fun with ScapeMaker new flexible interfaces. Daniel Wolf MegageM 1903 Adria Santa Maria, CA 93454 Phone: 805-349-1104 Compuserve: 70250,626