Scorpwanna, hash tables are very easy to use with multiple words if needed. As I stated in my original post, I could easily add that if he wanted it added. They are definitely faster than reading the data and the script can be much smaller.

Sukai:
Ok, you're right that I forgot about the test I was doing and didn't change it. Here's the update including the other information you asked for. If you need anything else added, just let me know.

Code:
alias -l CreateHelp {
  hmake Help 100
  if ($isfile(Help.hsh)) { hload Help Help.hsh }
}

on *:start: {
  CreateHelp
}

on *:text:*:#: {
  if ($1 != !learn && $1 != !replace && $1 != !append && $1 != !delete && $1 != $chr(63)) { return }
  if (!$2) { msg $chan Please include a keyword with the command | return }
  if ($hget(Help) == $null) { CreateHelp }
  if ($1 == !learn) {
    if ($hget(Help,$2)) { msg $chan That keyword is already used.  Please choose another, or use !replace or !append. | return }
    msg $chan Learned $3-
    hadd Help $2-
  }
  elseif ($1 == $chr(63)) {
    var %data = $hget(Help,$2-)
    if (%data == $null) { msg $chan No help available on that item. }
    else {
      msg $chan %data
    }
  }
  elseif ($1 == !replace) {
    if ($hget(Help,$2)) {
      msg $chan Replaced $hget(Help,$2).data with $2-
      hadd Help $2-
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  elseif ($1 == !append) {
    if ($hget(Help,$2)) {
      msg $chan Appended $3- to $hget(Help,$2).data
      hadd Help $2 $hget(Help,$2) $3-
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  elseif ($1 == !delete) {
    if ($hget(Help,$2)) {
      msg $chan Deleted $2 -- $hget(Help,$2).data
      hdel Help $2
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  hsave Help Help.hsh
}



USE:
!learn keyword description
!replace keyword new_description
!append keyword new_part_of_description
!delete keyword
? keyword

I didn't include !set as I'd have to redo a little of the hash table's data on the script. If you really want it, I can add it easily enough.

Scorpwanna did have a good idea of listing the keywords, though if there are too many of them, this can be a problem. If you want that feature, it is also really easy to add with a hash table.

Note that I would also recommend making these commands only available to certain people. Otherwise, some malicious person could come through and either add all kinds of fake stuff or delete everything you have.

And, feel free to edit or remove the msg lines that tell the channel what happened if you don't like them. And adding color would probably look good as well.


Invision Support
#Invision on irc.irchighway.net