From WikiChip
Difference between revisions of "mirc/commands/echo"
Maroonbells (talk | contribs) m (switchbar example) |
(→Other switches) |
||
Line 30: | Line 30: | ||
* '''-q''' - Honors the $show flag. (If the alias was called with the . prefix) | * '''-q''' - Honors the $show flag. (If the alias was called with the . prefix) | ||
* '''-n''' - Prevents switchbar button/treebar colour change | * '''-n''' - Prevents switchbar button/treebar colour change | ||
− | * '''-m''' - Treats the line as an user message, | + | * '''-m''' - Treats the line as an user message, colors the window button in the switchbar/treebar with the "Message" colour defined in the option alt+o>Display. |
== Parameters == | == Parameters == |
Revision as of 13:09, 20 October 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The /echo command prints text to the specified window. This command does not send anything to the server; text is only shown in the window.
Note: If you use /echo to send text to a custom listbox window which has been opened by /window -s, the line will be added added at the bottom of the window rather than being inserted in the correct sort position.
Contents
Synopsis
/echo [colour-number] [-deghiNtsaqlbfnmr] [window] <text> /echo -c[deghiNtsaqlbfnmr] <colour-name> [window] <text>
Switches
Target window swiches
- -s - prints to the status window
- -a - prints to the active window
- -d - prints to the single message window
Settings Related:
- -r - Applies the strip settings to the text (as defined in mIRC Options / IRC / Messages).
- -l - Applies the highlight settings to the text (as defined in mIRC Address Book / Highlight).
- -b - Applies the windows beep settings (to beep if mIRC is not the active application) as defined in mIRC Options / Sounds and any individual window override.
- -f - Applies the flash settings to the window (to flash the mIRC System Tray icon) as defined in mIRC Options / IRC / Options and any individual window override.
Other switches
- -c - Indicates that the <colour-name> parameter is provided.
- -e - Encloses the text with a pair of line separators
- -g - Prevents the text from being logged if the window has logging on.
- -h - Applies a hard-wrap on the text so that the wrap point does not change when the window is resized. Text is not wrapped if it is echoed to a custom listbox window.
- -i<N> - Indents wrapped lines by <N> characters. The standard mIRC indent is 2 spaces.
- -t - Adds a timestamp to the text if the timestamp is enabled for that window. Without this, the line will not be timestamped even if the window has timestamping set. Note: Custom windows
- -q - Honors the $show flag. (If the alias was called with the . prefix)
- -n - Prevents switchbar button/treebar colour change
- -m - Treats the line as an user message, colors the window button in the switchbar/treebar with the "Message" colour defined in the option alt+o>Display.
Parameters
- [colour-number] - A numeric colour value (0 to 15)
- <colour-name> - Used with the -c switch. One of the following: action, ctcp, highlight, info, info2, invite, join, part, quit, kick, mode, topic, nick, normal, notice, notify, other, own, wallops, whois
- [window] - The target window/channel/query
- <text> - The text to be printed
Examples
Example 1: Hello world
/echo -a Hello World!
Example 2: A loop prints a few lines
alias example { var %x = 5 while (%x) { echo -a This is example line $v1 $+ . dec %x } }
The above will print:
This is example line 5. This is example line 4. This is example line 3. This is example line 2. This is example line 1.
Example 3: Timestamps
echo #test This line never has a timestamp echo -t #test This line has a timestamp only if timestamping is enabled within #test echo #test $timestamp This line always has a timestamp
Example 4: Colours
//echo 4 -at abc $chr(22) def $chr(15) The timestamp and this text following the Ctrl-O revert to colour 4 (red) //echo -act ctcp abc $chr(22) def $chr(15) The timestamp and this text following the Ctrl-O revert to "ctcp" colour ( $+ $color(ctcp) $+ ) //echo -at $chr(3) $+ 04 $+ abc $chr(22) def $chr(15) The timestamp and this text appear as "normal" colour ( $+ $color(normal) $+ )
Example 5: Switchbar/treebar colours
; See mirc-options/display ; The 1st line causes the switchbar to change to the "event" colour. ; The 2nd line -m causes the switchbar to change to the "messages" colour, overriding the default EVENT colour. ; The 3rd line -n leaves the switchbar colour unchanged. ; Note that Chanserv giving the joined nick OP level is a separate event, and mIRC will change the -m override, and that event will color the switchbar as the EVENT colour. on ^*:JOIN:#:{ echo $color(join) -t # * $nick $+($chr(40),$gettok($fulladdress,2-,33),$chr(41)) has joined # $comchan($nick,0) echo $color(join) -tm # * $nick $+($chr(40),$gettok($fulladdress,2-,33),$chr(41)) has joined # $comchan($nick,0) echo $color(join) -tn # * $nick $+($chr(40),$gettok($fulladdress,2-,33),$chr(41)) has joined # $comchan($nick,0) haltdef }
/echo -m @window test /echo -m #channel test ;has the same effect as: /echo @window test /echo #channel test /window -g1 @window /window -g1 #channel
Compatibility
Added: mIRC v3.7
Added on: 12 Oct 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also
mIRC commands list