From WikiChip
Difference between revisions of "mirc/commands/sline"
< mirc‎ | commands

(Examples)
(Synopsis)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
The '''/sline''' command is used to select a line, or a specific set of lines, in a specific window. This command works on most custom @windows, as well as channel nickname lists.
 
The '''/sline''' command is used to select a line, or a specific set of lines, in a specific window. This command works on most custom @windows, as well as channel nickname lists.
  
= Synopsis =
+
== Synopsis ==
 
<source lang="mIRC">/sline [c] -artc[N] <#channel> <N|nick></source>
 
<source lang="mIRC">/sline [c] -artc[N] <#channel> <N|nick></source>
  
<source lang="mIRC">/sline -artc[N] <@win> <N></source>
+
<source lang="mIRC">/sline [c] -artc[N] <@win> <N></source>
  
= Switches =
+
== Switches ==
 
* '''-a''' - Causes the selection to select the new line while retaining all previous selections
 
* '''-a''' - Causes the selection to select the new line while retaining all previous selections
 
* '''-r''' - Removes selections from either all lines or the Nth line (cannot unselect specific multiple lines at once).
 
* '''-r''' - Removes selections from either all lines or the Nth line (cannot unselect specific multiple lines at once).
Line 13: Line 13:
 
* '''-c[N]''' - Same as using the [c] parameter to change the color, but via a switch
 
* '''-c[N]''' - Same as using the [c] parameter to change the color, but via a switch
  
= Parameters =
+
== Parameters ==
<span style="display: inline-block; width: 80px;">'''#channel'''</span>Specifies the window that you wish to target.
+
* '''#channel''' - Specifies the window that you wish to target.
 
+
* '''N|nick''' - Tells mIRC which line number you wish to select, if using a channel window, you can pass a nickname to be matched against and that line number will be used
<span style="display: inline-block; width: 80px;">'''N|nick'''</span>Tells mIRC which line number you wish to select, if using a channel window, you can pass a nickname to be matched against and that line number will be used
 
  
 +
== Examples ==
  
 
<pre>/sline #example awesomePerson
 
<pre>/sline #example awesomePerson
Line 29: Line 29:
 
<pre>/sline -r #example 1</pre>
 
<pre>/sline -r #example 1</pre>
 
<pre>/sline -r #example</pre>
 
<pre>/sline -r #example</pre>
 
= Code =
 
Why don't we go ahead and take a look at a custom alias command that highlights all lines in a specific window? Furthermore, let's also add some error checking to make sure the window that is specified is either a channel or a list window. Why would we do that? Well, because normal ''@window''s don't allow multi-line highlights, so we want to limit our custom alias to windows capable of multiple selections.
 
 
<source lang="mIRC">
 
alias selectall {
 
 
  ; Let's make sure the specified window is either a
 
  ; channel or a listbox window.
 
  if (($window($1).type == listbox) || ($1 ischan)) {
 
 
    ; Since we made sure that we are dealing with a
 
    ; channel or listbox window, %m, or maximum line
 
    ; variable, is now set to how many lines are
 
    ; available in the window that is passed to the
 
    ; alias.
 
    var %i = 1, %m = $iif($1 ischan,$nick($1,0),$line($1,0))
 
 
    ; Our loop that makes sure that our counter is
 
    ; less than the maximum amount of lines in the
 
    ; specified window.
 
    while (%i <= %m) {
 
 
      ; Add to the currently selected lines
 
      sline -a $1 %i
 
      inc %i
 
    }
 
  }
 
}</source>
 
In order to use this custom alias, you would simply type ''/selectall <#/@window>''. For instance, if you were on ''#example'', you would type:
 
 
<pre>/selectall #example</pre>
 
 
And there you have it, a remarkably easy example showing the power of ''/sline''. What's that? You want a ''usefuller'' script of some sort? Alright! :)
 
 
== A ''usefuller'' script of some sort ==
 
I'm not exactly sure what the heck a ''usefuller' script of some sort is, but I'll do my best. Let's say you're in multiple channels, and you want to select the nickname of someone who is also in some of those channels (they don't have to be in any of them, or even all of them; even just one is fine). How would we do this? Simple:
 
 
<source lang="mIRC">alias seluser {
 
 
  ; Create our temporary variables. The %c
 
  ; variable stores the amount of channels we
 
  ; are on. This is for our loop. The %n
 
  ; variable stores the nickname that has
 
  ; been passed to the alias.
 
  var %c = $chan(0), %n = $1
 
 
  ; Now, we simply loop through each channel
 
  ; and pass along our /sline command in
 
  ; order to select the specified nickname.
 
  while (%c) { sline $chan(%c) %n | dec %c }
 
}</source>
 
 
In order to use this, you would simply type ''/seluser <nickname>''. So, for instance, say we wanted to select the nickname ''awesomePerson'' on all channels that we are in, we would type:
 
 
<pre>/seluser awesomePerson</pre>
 
 
It's a good time to mention that if the nickname does not exist on that channel, or even any channels, mIRC won't produce an error; the script will simply continue on to the next loop iteration.
 
 
= Conclusion =
 
Now that you've seen some of the more uncommon ways that even something as simple as ''/sline'' can be utilized, you'll understand why many of mIRC's features go overlooked. Simply practice and you will be on your way to being an mSL guru in no time!
 
  
 
== See also ==
 
== See also ==

Latest revision as of 20:55, 17 March 2023

The /sline command is used to select a line, or a specific set of lines, in a specific window. This command works on most custom @windows, as well as channel nickname lists.

Synopsis[edit]

/sline [c] -artc[N] <#channel> <N|nick>
/sline [c] -artc[N] <@win> <N>

Switches[edit]

  • -a - Causes the selection to select the new line while retaining all previous selections
  • -r - Removes selections from either all lines or the Nth line (cannot unselect specific multiple lines at once).
  • -t - forces a re-wrap of all lines in a window that have not yet been wrapped to the current window size.
  • -c[N] - Same as using the [c] parameter to change the color, but via a switch

Parameters[edit]

  • #channel - Specifies the window that you wish to target.
  • N|nick - Tells mIRC which line number you wish to select, if using a channel window, you can pass a nickname to be matched against and that line number will be used

Examples[edit]

/sline #example awesomePerson
/sline -a #example John
/sline -a #example UhOh
/sline @win 1
/sline -r #example awesomePerson
/sline -r #example 1
/sline -r #example

See also[edit]

v · d · e mIRC commands list

A /abook, /action, /add, /ajinvite, /alias, /aline, /ame, /amsg, /anick, /aop, /auser, /auto, /autojoin, /avoice, /away

B /background, /ban, /bcopy, /beep, /bindip, /bread, /break, /breplace, /bset, /btrunc, /bunset, /bwrite

C /channel, /clear, /clearall, /clearial, /cline, /clipboard, /close, /closechats, /closedccs, /closefserves, /closemsg, /cnick, /color, /colour, /comclose, /comlist, /commands, /comopen, /comreg, /continue, /copy, /creq, /ctcp, /ctcpreply, /ctcps

D /dcc, /dccserver, /dde, /ddeserver, /debug, /dec, /describe, /dialog, /did, /didtok, /disable, /disconnect, /dlevel, /dline, /dll, Template:mIRC/donotdisturb, /dns, /dqwindow, /drawcopy, /drawdot, /drawfill, /drawline, /drawpic, /drawrect, /drawreplace, /drawrot, /drawsave, /drawscroll, /drawsize /drawtext

E /ebeeps, /echo, /editbox, /else, /elseif, /emailaddr, /enable, /events, /exit

F /fclose, /filter, /findtext, /finger, /firewall, /flash, /flist, /flood, /flush, /flushini, /fnord, /font, /fopen, /fseek, /fsend, /fserve, /fullname, /fupdate, /fwrite

G /ghide, /gload, /gmove, /gopts, /goto, /gplay, /gpoint, /gqreq, /groups, /gshow, /gsize, /gstop, /gtalk, /gunload, /guser

H /hadd, /halt, /haltdef, /hdec, /hdel, /help, /hfree, /hinc, /hload, /hmake, /hotlink, /hop, /hsave

I /ial, /ialclear, /ialmark, /identd, /if, /ignore, /iline, /inc, /iuser

J /join

L /leave, /linesep, /links, /list, /load, /loadbuf, /localinfo, /log, /logview

M /maxdepth, /mdi, /me, /menubar, /mkdir, /mnick, /mode, /msg

N /noop, /notice, /notify

O /onotice, /omsg

P /pareline, /part, /partall, /pdcc, /perform, /play, /playctrl, /pop, /protect, /proxy, /pvoice

Q /qme, /qmsg, /query, /queryrn, /quit, /quote

R /raw, /registration, /reload, /remini, /remote, /remove, /rename, /renwin, /reseterror, /resetidle, /return, /returnex, /rlevel, /rline, /rmdir, /run, /ruser

S /save, /savebuf, /saveini, /say, /scid, /scon, /server, /set, /setlayer, /showmirc, /signal, /sline, /sockaccept, /sockclose, /socklist, /socklisten, /sockmark, /sockopen, /sockpause, /sockread, /sockrename, /sockudp, /sockwrite, /sound, /speak, /splay, /sreq, /strip, /switchbar

T /timer, /timestamp, /tip, /tips, /titlebar, /tnick, /tokenize, /toolbar, /topic /tray, /treebar

U /ulist, /unload, /unset, /unsetall, /updatenl, /url, /username, /uwho

V /var, /vcadd, /vcmd, /vcrem, /vol

W

X /xyzzy