mIRC Home    About    Download    Register    News    Help

Print Thread
/hadd -uN cant be saved to file #103745 24/11/04 12:27 PM
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?

Re: /hadd -uN cant be saved to file #103746 24/11/04 07:19 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
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.
Re: /hadd -uN cant be saved to file #103747 24/11/04 09:21 PM
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.

Re: /hadd -uN cant be saved to file #103748 25/11/04 12:09 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
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.
Re: /hadd -uN cant be saved to file #103749 26/11/04 03:18 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
maybe he wants them to unset while in the file (snicker snicker)

Re: /hadd -uN cant be saved to file #103750 26/11/04 07:28 AM
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.

Re: /hadd -uN cant be saved to file #103751 26/11/04 10:21 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: /hadd -uN cant be saved to file #103752 26/11/04 01:18 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
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.

Re: /hadd -uN cant be saved to file #103753 26/11/04 08:58 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
lol yeah im SURE there stored in memory just the same way.

Re: /hadd -uN cant be saved to file #103754 07/12/04 04:06 PM
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

Re: /hadd -uN cant be saved to file #103755 07/12/04 08:16 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.