From WikiChip
Difference between revisions of "mirc/identifiers/$cb"
(→Synopsis) |
m (→Compatibility: This was added in 3.5) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
== Synopsis == | == Synopsis == | ||
− | <source lang="mIRC">$cb | + | <source lang="mIRC"> |
+ | $cb | ||
+ | $cb(N,[u],[%var|&binvar])</source> | ||
== Parameters == | == Parameters == | ||
* '''N''' - The Nth {{mIRC|$crlf}} delimited line in the clipboard, you can use -1 to get the full clipboard with newline included. | * '''N''' - The Nth {{mIRC|$crlf}} delimited line in the clipboard, you can use -1 to get the full clipboard with newline included. | ||
* '''u''' - Return the text encoded to utf8 | * '''u''' - Return the text encoded to utf8 | ||
+ | * '''%var|&binvar''' - You can pass a variable or a binary variable to be filled instead of being returned by $cb, using a binvar allow you to handle more than the current line lenght limit of 8292 char. | ||
== Properties == | == Properties == | ||
* '''.len''' - returns the length of the Nth line | * '''.len''' - returns the length of the Nth line | ||
+ | * '''.utflen''' - returns the len of the text encoded to utf8, same as .len with the 'u' parameter | ||
+ | * '''.utf''' - This property appears in the source code but does not work, it looks like the source code is not checking the proper variable handling the prop name. It would naturally return the text encoded to utf8 | ||
+ | |||
+ | |||
== Example == | == Example == | ||
Line 40: | Line 47: | ||
== Compatibility == | == Compatibility == | ||
− | {{mIRC compatibility| | + | {{mIRC compatibility|3.5}} |
== See Also == | == See Also == |
Latest revision as of 02:07, 5 February 2024
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The $cb identifier allows mIRC to return the contents of the Windows Clipboard.
Synopsis[edit]
$cb $cb(N,[u],[%var|&binvar])
Parameters[edit]
- N - The Nth $crlf delimited line in the clipboard, you can use -1 to get the full clipboard with newline included.
- u - Return the text encoded to utf8
- %var|&binvar - You can pass a variable or a binary variable to be filled instead of being returned by $cb, using a binvar allow you to handle more than the current line lenght limit of 8292 char.
Properties[edit]
- .len - returns the length of the Nth line
- .utflen - returns the len of the text encoded to utf8, same as .len with the 'u' parameter
- .utf - This property appears in the source code but does not work, it looks like the source code is not checking the proper variable handling the prop name. It would naturally return the text encoded to utf8
Example[edit]
Echo clipboard contents to the active window:
//echo -a $cb
Echo the total number of clipboard entires to the active window:
//echo -a $cb(0)
Create a custom alias that will open a custom window @myWindow, and then echo all clipboard line contents to it:
; Use: /cblist alias cblist { ; Open the window, and clear it just in case it was already opened window @myWindow clear @myWindow ; Set the %i, our counting variable, to the start value of 1, and ; set the %x variable to the amount of lines in the clipboard var %i = 1, %x = $cb(0) ; Loop until %x has gone through all clipboard contents while (%i <= %x) { echo @myWindow $cb(%i) inc %i } echo @myWindow Clipboard contents finished! }
Compatibility[edit]
Added: mIRC v3.5
Added on: 07 Aug 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See Also[edit]
mIRC identifier list