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

m (Bot: Adding a template)
m (bot: sort-key added to category)
Line 57: Line 57:
 
{{mIRC command list}}
 
{{mIRC command list}}
  
[[Category:MIRC commands]]
+
[[Category:mIRC commands|hdec command - mIRC]]

Revision as of 20:12, 29 July 2014

Template:mIRC menu The /hdec command decreases the value of a key by [num]. If the value is not specified, the default value is 1.0.

Synopsis

/hdec [-mszu#] <key> [num] /hdec -b[cmszu#]
<key> <&bvar>

Switches

  • -m - Creates the hash table if it does not exist
  • -s - Displays the assignment information
  • -b - Treats the value as a binary variable
  • -c - Truncates the &bvar at the first null value
  • -z - Decreases the value by 1.0 every second; stops at zero
  • -u# - Removes the key/value after # seconds

Parameters

- The handle name of the table to operate on
  • <key> - The key associated with the value
  • [num] - The value to decrease the value by
  • <&bvar> - The binary variable value to decrease the value by
  • Example

    alias countdown {
      ;adds the item down with a value of 10 to the table count
      hadd -m count down 10
      echo -a $hget(count,down) $+ !
      :repeat
      ;checks if the value of down returns true
      if ($hget(count,down) > 1) {
        ;decreases down by 1
        hdec count down
        ;echos the current count
        echo -a $hget(count,down) $+ !
        ;repeats
        goto repeat
      }
      ;if the previous if statement returns false it carries on with this.
      else echo -a 0, Hurray!
      hfree -s count
    }

    Compatibility

    Added: mIRC v6.0
    Added on: 03 Feb 2002
    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