Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.SetSelection


Name SetSelection
Type Method
Summary Sets a selection range in the output window
Prototype void SetSelection(long StartLine, long EndLine, long StartColumn, long EndColumn);
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.


Note: Available in version 5.07 onwards.


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)
Returns Nothing.
Introduced in version 5.07

See also ...

Function Description
GetSelectionEndColumn Returns the endling column of the selection in the output window
GetSelectionEndLine Returns the last line of the selection in the output window
GetSelectionStartColumn Returns the starting column of the selection in the output window
GetSelectionStartLine Returns the starting line of the selection in the output window

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.