From WikiChip
mirc/commands/hinc
< mirc‎ | commands
Revision as of 20:44, 3 July 2014 by PatrolBot (talk | contribs) (Bot: Adding a template)

The /hinc command increases the value of a key by [num]. If the value is not specified, the default value is 1.0.

Synopsis

/hinc [-mszu#] <table> <key> [num] 
/hinc -b[cmszu#] <table> <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

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

Example 1:

alias example {
  ;create the table
  hmake -s example
 
  ;add a few items
  hadd example item1 4
  hadd example item2 7
  hadd example item3 9
 
  ; print the items
  echo -a item1 = $hget(example, item1)
  echo -a item2 = $hget(example, item2)
  echo -a item3 = $hget(example, item3)
 
  ; increase the values
  hinc example item1 5
  hinc example item2 12
  hinc example item3 1
  
  echo -e -
 
  ; print the items
  echo -a item1 = $hget(example, item1)
  echo -a item2 = $hget(example, item2)
  echo -a item3 = $hget(example, item3)
 
  ;cleanup
  hfree -s example
}

A counter example:

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

Compatibility

Added: mIRC v6.0

Added On: 03/02/2002

Note: Individual switches were not taken into consideration.

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