/* BoxMe.rexx An ARexx script designed to work with AmiSlate. Draws a box around the current mouse position whenever the user presses or lets go of the left mouse button in the drawing window. */ parse arg CommandPort ActiveString if (length(CommandPort) == 0) then do say "" say "Usage: rx boxme.rexx " say " (REXXPORTNAME is usually AMISLATE)" say "" say "Or run from the Rexx menu within AmiSlate." say "" exit 0 end address (CommandPort) options results /* Constants for use with AmiSlate's ARexx interface */ AMessage.TIMEOUT = 1 /* No events occurred in specified time period */ AMessage.MESSAGE = 2 /* Message recieved from remote Amiga */ AMessage.MOUSEDOWN = 4 /* Left mouse button press in drawing area */ AMessage.MOUSEUP = 8 /* Left mouse button release in drawing area */ AMessage.RESIZE = 16 /* Window was resized--time to redraw screen? */ AMessage.QUIT = 32 /* AmiSlate is shutting down */ AMessage.CONNECT = 64 /* Connection established */ AMessage.DISCONNECT = 128 /* Connection broken */ AMessage.TOOLSELECT = 256 /* Tool Selected */ AMessage.COLORSELECT = 512 /* Palette Color selected */ AMessage.KEYPRESS = 1024 /* Key pressed */ do while (1=1) WaitEvent MOUSEDOWN MOUSEUP QUIT stem e. t = e.type if (t = AMessage.MOUSEDOWN) then do setfpen 7 square e.x-5 e.y-5 e.x+5 e.y+5 end if (t = AMessage.MOUSEUP) then do setfpen 1 square e.x-5 e.y-5 e.x+5 e.y+5 end if (t = AMessage.QUIT) then exit e.type = 0 end