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

(Synopsis)
(Switches)
Line 6: Line 6:
  
 
== Switches ==
 
== Switches ==
* '''-c''' - Decreases the variable once per second
 
 
* '''-s''' - Prints out the value of the variable
 
* '''-s''' - Prints out the value of the variable
 +
Global variables only:
 +
* '''-c''' or '''-r''' - Decreases the variable once per second
 
* '''-z''' - Decreases the variable every second until it reaches zero at which point the variable will get removed.
 
* '''-z''' - Decreases the variable every second until it reaches zero at which point the variable will get removed.
 
* '''-e''' - Unsets the variable when mIRC exits
 
* '''-e''' - Unsets the variable when mIRC exits
 
* '''-uN''' - Decrease the variable once and unsets the variable after N seconds.
 
* '''-uN''' - Decrease the variable once and unsets the variable after N seconds.
 
* '''-k''' - Keeps the unset time of the variable if it exists. Watch out, currently -k in /dec does not behave the same as in {{mIRC|/set}}, as in, if you provide another -uN switch AND a -k switch, it will use this new unset time and won't preserve the original one.
 
* '''-k''' - Keeps the unset time of the variable if it exists. Watch out, currently -k in /dec does not behave the same as in {{mIRC|/set}}, as in, if you provide another -uN switch AND a -k switch, it will use this new unset time and won't preserve the original one.
 
  
 
== Parameters ==
 
== Parameters ==

Revision as of 11:22, 12 July 2020

The /dec command decreases the value of a variable by a given value. If no value is specified, mIRC will decrease the variable by one. The /dec command works with both positive and negative values alike.

Synopsis

/dec [-crszeuNk] <%var> [value]

Switches

  • -s - Prints out the value of the variable

Global variables only:

  • -c or -r - Decreases the variable once per second
  • -z - Decreases the variable every second until it reaches zero at which point the variable will get removed.
  • -e - Unsets the variable when mIRC exits
  • -uN - Decrease the variable once and unsets the variable after N seconds.
  • -k - Keeps the unset time of the variable if it exists. Watch out, currently -k in /dec does not behave the same as in /set, as in, if you provide another -uN switch AND a -k switch, it will use this new unset time and won't preserve the original one.

Parameters

  • %var - The variable's name
  • [value] - Optional numeric value to decrease the variable by

Example

Alias Example {
  ;Create a local variable and set it to 10
  var %x 10
  ;Decrease %x by 5 
  dec %x 5
  ;Print out %x's content
  echo -a %x
}

Compatibility

Added: mIRC v4.0
Added on: 20 Mar 1996
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 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