Create a text file acros.txt and put it in your main mIRC folder. The text file should be ordered like this:


[hashtable]
lol=laughing out loud
lmao=laughing my ass off
...


Then: Start -> Run -> Wordpad -> Paste code into Wordpad -> Copy/paste from wordpad to mIRC Scripts Editor (alt+r) into tab "Remote"

Code:
#acronyms on
on *:START: loadacros
 [color:red]  [/color] 
on *:INPUT:*:{
  if /* !iswm $1 && !$ctrlenter && !$inpaste {
    haltdef
    msg $active $acronym($$1-)
  }
}
#acronyms end
 [color:red]  [/color] 
alias acronym {
  var %a = $1, %b = 1
  while $hfind(acros,$lower($1),%b,R) {
    .echo -q $regsub(%a,/(?<=^|\s) $+ $v1 $+ (?=\s|$)/gi,$hget(acros,$v1),%a)
    inc %b
  }
  return %a
}
 [color:red]  [/color] 
alias addacro {
  if !$2 { echo -a You have to specify a translation for the item: $1 | return }
  if !$hget(acros) { loadacros }
  if $hget(acros,$1) { hdel acros $1 }
  hadd acros $1 $2-
  hsave -oi acros acros.txt
  echo -a Added acronym: $1 with translation: $2-
}
 [color:red]  [/color] 
alias delacro {
  if !$1 { echo -a You must specify an acronym | return }
  if !$hget(acros) { loadacros }
  if !$hget(acros,$1) { echo -a There is no such acronym: $1 | return }
  hdel acros $1
  hsave -oi acros acros.txt
  echo -a Deleted acronym: $1 
}
 [color:red]  [/color] 
alias loadacros {
  if $hget(acros) { hfree acros }
  hmake acros
  hload -i acros acros.txt
}
 

As you can see I added 2 aliases that allow you to add/delete/overwrite acronyms. You can also manually add/delete/edit the acronyms in the acros.txt file, but then they are not updated in the hash table yet. Then you should type /loadacros, which will update the acronyms hash table.

Enjoy

Last edited by FiberOPtics; 07/09/04 10:59 AM.

Gone.