mIRC Homepage

/hadd, mask

Posted By: bebegood

/hadd, mask - 04/04/10 03:21 PM

can u add mask support to hadd also ? (like /hdel -w)

just i use hash for players and their scores

to reset example: /hadd -w player.* 0
will be very good for me.
thx anyway.

p.s Yes i can use $hfind, and while, i know, don't need tell me about it, it's just my question can it be added or no.
Posted By: Riamus2

Re: /hadd, mask - 04/04/10 04:04 PM

If you are resetting scores, you are much better off with an alias that creates the table in the beginning that can be used to re-create it anytime it needs "reset".
Posted By: argv0

Re: /hadd, mask - 04/04/10 06:48 PM

It *could* be added, but it doesn't seem all that useful outside this very specific use-case. It would be asking for something like

/set -w %var.* 0

When you could just do

/unset %var.*

Seems very much like an edge case. Write your loop or just reset the table with { hdel tab | hmake tab 100 } (which, as mentioned, your initializing alias should already do)
Posted By: genius_at_work

Re: /hadd, mask - 04/04/10 10:17 PM

I think this would be a useful addition to the hash commands. The -w switch could be added to /hinc and /hdec as well.

[htbl]
var.A 1
bob.B 2
var.C 3
var.D 4
bob.E 5
var.F 6
bob.G 7
var.H 8

/hinc -sw htbl var.* 3
- Incremented 5 matching hash items by 3


/hdec -sw htbl var.* 8
- Decremented 5 matching hash items by 8


/hadd -sw htbl var.* 43
- Set 5 matching hash items to 43



Can these be scripted? Yes. But then, so could have /hdel -w htbl var.* or /unset %var.*

-genius_at_work
Posted By: s00p

Re: /hadd, mask - 06/04/10 04:53 AM

Ever considered a database? They're actually designed for that sort of functionality, where as a hashtable, well... It's sort of inefficient.
© 2022 mIRC Discussion Forums