Hadd » History » Version 4
  Per Amundsen, 11/30/2018 11:02 AM 
  
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ | 
|---|---|---|---|
| 2 | |||
| 3 | 4 | Per Amundsen | */hadd [-bBcmsuNz] <name> <item> [text | &binvar]* | 
| 4 | 1 | Per Amundsen | |
| 5 | *Switches* | ||
| 6 | |||
| 7 | -b - Indicates &binvar is set. | ||
| 8 | 3 | Per Amundsen | -B - TODO | 
| 9 | 1 | Per Amundsen | -c - Chop the &binvar to first null byte. | 
| 10 | -m - Creates the table if it does not exist. | ||
| 11 | -s - Displays the result. | ||
| 12 | -uN - Unset the item after N seconds. | ||
| 13 | -z - Decreases the item once per second until it reaches zero and then unsets it. | ||
| 14 | |||
| 15 | *Parameters* | ||
| 16 | |||
| 17 | <name> - The hash table to add to. | ||
| 18 | <item> - The hash table item to add to. | ||
| 19 | [text | &binvar] - The text or &binvar value to add. | ||
| 20 | |||
| 21 | *Example* | ||
| 22 | |||
| 23 | <pre> | ||
| 24 | ; call the setup once | ||
| 25 | ; /abbr_setup | ||
| 26 | ; | ||
| 27 | ; //echo -a $abbr(lol) | ||
| 28 | ; | ||
| 29 | alias abbr_setup { | ||
| 30 | ;Populate the table, create it if it does not exist. | ||
| 31 | hadd -m abbr lol laughing out load | ||
| 32 | hadd abbr omg oh my gosh | ||
| 33 | hadd abbr lmao laughing my a?? off | ||
| 34 | hadd abbr brb be right back | ||
| 35 | } | ||
| 36 | 2 | Per Amundsen | |
| 37 | 1 | Per Amundsen | ;Get the abbreviation. | 
| 38 | alias abbr return $hget(abbr, $1) | ||
| 39 | </pre> |