From WikiChip
Difference between revisions of "mirc/identifiers/$cb"
< mirc‎ | identifiers

(Created $cb identifier - mIRC)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''$cb''' identifier allows mIRC to return the contents of the Windows Clipboard.
+
{{mirc title|$cb Identifier}}The '''$cb''' identifier allows mIRC to return the contents of the Windows Clipboard.
 +
 
  
 
== Synopsis ==
 
== Synopsis ==
<source lang="mIRC">$cb[(N)[.len]]</source>
+
<source lang="mIRC">
 +
$cb
 +
$cb(N,[u],[%var|&binvar])</source>
  
 
== Parameters ==
 
== Parameters ==
{{ArgsList
+
* '''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 item in the clipboard to retrieve specific data for
+
* '''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 ==
{{ArgsList
+
* '''.len''' - returns the length of the Nth line
| len | Returns length information regarding clipboard items
+
* '''.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 36: Line 41:
 
   while (%i <= %x) {
 
   while (%i <= %x) {
 
     echo @myWindow $cb(%i)
 
     echo @myWindow $cb(%i)
     inc %x
+
     inc %i
 
   }
 
   }
 
   echo @myWindow Clipboard contents finished!
 
   echo @myWindow Clipboard contents finished!
Line 42: Line 47:
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v6.2
+
{{mIRC compatibility|6.2}}
 
 
Added On: 28/07/2006
 
  
 
== See Also ==
 
== See Also ==
 
* [[List of identifiers - mIRC|mIRC Identifiers]]
 
* [[List of identifiers - mIRC|mIRC Identifiers]]
 +
{{mIRC identifier list}}
  
[[Category:mIRC identifiers]]
+
[[Category:mIRC identifiers|cb]]

Revision as of 18:46, 6 July 2020

The $cb identifier allows mIRC to return the contents of the Windows Clipboard.


Synopsis

$cb
$cb(N,[u],[%var|&binvar])

Parameters

  • 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

  • .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

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

Added: mIRC v6.2
Added on: 28 Jul 2006
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also

v · d · e mIRC identifier list

$ $$, $, $0, $1-, $!, $&, $*, $+, $++, $?

A $abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime

B $banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes

C $calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter

D $date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration

E $ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting

F $false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen

G $get, $getdir, $getdot, $gettok, $gmt, $group

H $halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot

I $iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf

K $keychar, $keyrpt, $keyval, $knick

L $lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer

M $maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags

N $N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick

O $ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os

P $parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok

Q $qt, $query

R $r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round

S $samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir

T $tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust

U $ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode

V $v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol

W $wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap

X $xor

Y $yes

Z $zip

= =$nick