mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 42
T
TroyBoy Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
Im adding a timed hash entry every 60 secs so I have 12 hours of data in my hash table (720 entries).

hadd -mu43200 sharesAbuy $ctime $round(%priceA,3)

(from the help file):
/hsave -sbnioau <name> <filename> [section]

None of those options will successfully save the hash table to file (the -uN times are lost).
Can a new option be added to be able to save this timed hash table to file?

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
To quote the help file:

Quote:
/hsave -sbnioau <name> <filename> [section]
...
By default /hsave excludes items that are in the /hadd -uN unset list, the -u switch forces it to include the unset items.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Aug 2004
Posts: 42
T
TroyBoy Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
I knew someone would mention it.

/hsave -u sharesAbuy sharesAbuy.txt

heres the sharesAbuy.txt:

1101329633
380.937
1101329393
388.552
1101328673
416.211
1101328433
404.062
.
.

notice how theres only the item name, and the value.
If I load that file back into a hash table, its lost the unset values.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well yeah, the time-to-unset is lost. But what good is that anyway? Obviously it's not counting down while it's saved so any amount of time could pass in between a call to /hsave and another to /hload, so what's the use in retaining the unset time?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
maybe he wants them to unset while in the file (snicker snicker)

Joined: Aug 2004
Posts: 42
T
TroyBoy Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
Well it depends what youre using the countdown in the hash for.
Obviously I dont care about the period thats past while mirc is offline.
That is why im making a suggestion to be able to /hsave the unset data.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
well ok, im just not sure were it would be saved, the file formats already defined. Maybe you could do a work around, set timers off to unset the data (which is actually a more accuarte timed method of unsetting) and if you save the hash table save all relevent timers to another file also.

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
While you might concider;

item1
data1
item2
data2
...

A 'file format', I would concider it a memory dump.

Eamonn.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
lol yeah im SURE there stored in memory just the same way.

Joined: Aug 2004
Posts: 42
T
TroyBoy Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
I can easily script a workaround, but obviously its not very efficient compared to /hsave and /hload!
Im talking 5 hash tables, each with 720 timed items. Looping through them and writing to file isnt the fastest thing on earth in mirc smirk

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
I can easily script a workaround, but obviously its not very efficient compared to /hsave and /hload!
Im talking 5 hash tables, each with 720 timed items. Looping through them and writing to file isnt the fastest thing on earth in mirc smirk


You can still use /hload and /hsave, what i ment was this
instead of using the internal -u option to unset the value u uses a timer to unset it, you can easly name the timers with an identifiable extention, and then save them all to a file when you /hsave, and then if u /hload you can luanch the timers again to unset the values.
My comment on this being a better system is becuase the -u option does not account for moments when mirc is frozen doing other things, ie -u10 then mirc freezes for 3 seconds, and it well unset in 13 seconds from the set time, a timer well go off at 10 seconds or as soon after 10 as mirc unfreezes.


Link Copied to Clipboard