Originally Posted by beer
Thanks once again Raccoon!

On a kinda similar note, is there a better method between having one hash table with long data for each item (say 100-300 characters), or a few hash tables with the data split between them (so say 3 hash tables where each item has 100 character data)? Nobody likes a slow script. smile


I typically, anymore, just assign one hashtable to a single script to handle all of its data storage. Then I name each item with prefixes / suffixes to identify the type of content that I'm storing. In practice, the only thing that makes hashtables slow is not knowing in advance what the item name is. It's always best to lookup an item rather than searching for it with $hfind(), which is slow.

So try not to worry about any other aspects like buckets or number of split up tables. The time savings would be negligible one way or another, and will change from mIRC version to version as updates are made to algorithms and speed improvements are introduced.

Code
var %reason User was running his mouth again.
var %table = kickscript
var %item = $+($network,.,$chan,.,$nick)
hinc -m %table $+(%item,.kickcount) 1
var %count = $hget(%table,$+(%item,.kickcount))
hadd -m %table $+(%item,.kickreason.,%count) %reason

; [kickscript]
; efnet.#mirc.raccoon.kickcount == 2
; efnet.#mirc.raccoon.kickreason.1 == User keeps harassing the ops.
; efnet.#mirc.raccoon.kickreason.2 == User was running his mouth again.

Last edited by Raccoon; 16/10/19 12:05 AM.

Well. At least I won lunch.
Good philosophy, see good in bad, I like!