mIRC Home    About    Download    Register    News    Help

Print Thread
Differences inbetween times && replacing hash item #147970 27/04/06 03:28 AM
Joined: Oct 2005
Posts: 122
O
onesikgypo Offline OP
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
1st thing - differences inbetween times

i know i can use $ctime then calculate the differences in between the two - but as it comes out in secods if i get something like 3454 seconds - doesnt really help - so is there a property im missing - or will i simply need to have various if events, i.e if (RESULT < 60) { , elseif (RESULT < 3600) etc ?

as for the 2nd problem

is it possible to replace a value in a hash table - or will i have to dlt then readd?

Re: Differences inbetween times && replacing hash item #147971 27/04/06 03:37 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
1. Do you mean $duration(3454) ? I don't fully understand.
2. You can most defintely replace data in a table but you can't replace an item it'd have to be deleted.

-Andy

Re: Differences inbetween times && replacing hash item #147972 27/04/06 03:50 AM
Joined: Oct 2005
Posts: 122
O
onesikgypo Offline OP
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
lol forgot about $duration that was the answer to my question

- to replace a data do i jus use same format

i.e
If
NICK bla bla bla

already existed in hashtable jus /hadd hashtable NICK newdata ?

Re: Differences inbetween times && replacing hash item #147973 27/04/06 04:00 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
alias hash {
  hadd -m MyHash onesikgypo This is me!
  echo -a onesikgypo added: $hget(MyHash,onesikgypo)
  hadd MyHash onesikgypo This is you!
  echo -a onesikgypo updated to: $hget(MyHash,onesikgypo)
  hfree MyHash
}


Basically typing:

/hadd -m MyHash onesikgypo foo
/hadd MyHash onesikgypo bar

Updates your item.

-Andy

Re: Differences inbetween times && replacing hash item #147974 27/04/06 08:38 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
lol your tring to confuse him!

/hadd tablename itemname itemdata
^ that creates the itemname if it dont exist
^ that replaces the itemname's data if it does