mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
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?

Joined: Dec 2002
Posts: 3,547
S
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

Joined: Oct 2005
Posts: 122
O
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 ?

Joined: Dec 2002
Posts: 3,547
S
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

Joined: Sep 2003
Posts: 4,230
D
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


Link Copied to Clipboard