mIRC Homepage
Posted By: RusselB hash table for dares - 24/03/05 02:43 AM
I'm looking for a hash table (or other storage method) that will keep track of the following:
  • Dare number
  • Daree (nick/address of person performing the dare)
  • Dare time (the length of the dare)
  • Dare Name or Description
  • Darer (nick/address of person that gave the dare)
Posted By: namnori Re: hash table for dares - 24/03/05 10:03 AM
usually, for stuff like that, i use a simple hash table, and for each you want to keep a track of, i use a token to split it up, so storing an entry is like

Code:
;item is the dare number
alias dare.add {
  hadd daretable %darenumber %daree @ %dare_time @ %dare_name @ %darer
}

and to retrieve data, I write a series of layers of alias

alias r.dare.daree {
  return $gettok($hget(daretable,$1),64,1)
}

alias r.dare.dare_time {
  return $gettok($hget(daretable,$1),64,2)
}
; etc...


You have to do a lot of checking to make sure each field is there, and have to pick the right token. sometimes i use $chr(160) (non breaking space) or $chr(44) (comma) for readability. just pick something that would rarely be used in the description, and make sure to filter it out incase it is.
Posted By: RusselB Re: hash table for dares - 25/03/05 03:06 AM
Thanks for the assistance.
© mIRC Discussion Forums