world.SetSelection

MUSHclient script function (Method) — introduced in version 5.07

Sets a selection range in the output window

Prototype

void SetSelection(long StartLine, long EndLine, long StartColumn, long EndColumn);

Data type meanings

Description

This sets a selection in the output window, as if you had clicked and dragged with the mouse. To clear an existing selection set the selection to be 1,1,1,1.

The selection column starts at 1. That is, column 1 is the left-most column.

The selection column range is half-open. That is, to select column 1 only you need to select 1,2 as the columns. This makes it possible to have no columns by using 1,1 as the column range.

Similarly, to select a single line, such as line 5, you can select like this:

SetSelection (5, 6, 1, 1)

That selects line 5 from column 1, up to line 6 column 1. As the end column is not included, that is therefore all of line 5.

If you have multiple output windows this function only affects the first one.

Lua example

-- Set selection starting from line 5, column 40, to line 10, column 50

SetSelection (5, 10, 40, 51)

-- (Note: Up to column 50 is selected because the column selection does not include the end column)

Return value

Nothing.

Related topic

Utilities

See also

FunctionDescription
GetSelectionEndColumnReturns the endling column of the selection in the output window
GetSelectionEndLineReturns the last line of the selection in the output window
GetSelectionStartColumnReturns the starting column of the selection in the output window
GetSelectionStartLineReturns the starting line of the selection in the output window