DR-A

By DarthReven on Mar 01, 2005

I got tired if using my previous acronym addon so i made one that is very customize able and can be used in any script by just using the alias with the ini file

menu nicklist,channel,menubar {
  -
  Acronyms
  .$iif($group(#acro) == on,Turn Acronyms Off,Turn Acronyms On) {
    if ($group(#acro) == on) {
      .disable #acro
      echo -a -> Acronyms Are Now Off
    }
    else {
      .enable #acro
      echo -a -> Acronyms Are Now On
    }
  }
  .-
  .Add an acronym {
    var %a $$?="Please enter the acronym: (Ex: lol)"
    if (!$readini(Acro.ini,Acronyms,%a)) {
      writeini Acro.ini Acronyms %a $$?="Please enter the meening of you acronym: (Ex: laughing out loud)"
      echo -a Added %a to the acronym list.
    }
    else {
      echo -a Sorry, %a is already in the acronym list.
    }
  }
  .Delete an acronym {
    var %d $$?="Please enter the acronym: (Ex: lol)"
    if ($readini(Acro.ini,Acronyms,%d)) {
      remini Acro.ini Acronyms %d
      echo -a Remove %d from acronym list.
    }
    else -a Sorry, %d wasn't in the acronym list.
  }
}
#acro off
on *:input:*: {
  if ($left($1,1) != $chr(47)) {
    msg $active $acro($1-)
    halt
  }
}
#acro end
alias acro {
  var %ax $1-
  var %ay $numtok(%ax,32)
  while (%ay) {
    if ($gettok(%ax,%ay,32) isalnum) {
      if ($readini(Acro.ini,Acronyms,$gettok(%ax,%ay,32))) {
        %ax = $reptokmcs(%ax,$gettok(%ax,%ay,32),$readini(Acro.ini,Acronyms,$gettok(%ax,%ay,32)),32)
      }
    }
    dec %ay
  }
  tokenize 32 %ax
  return $+($upper($left($1,1)),$mid($1-,2))
}
alias reptokmcs {
  var %t $1,%k $2,%r $3,%x $4,%f $findtok($1,$2,0,$4)
  while (%f) {
    %t = $reptok(%t,%k,%r,%f,%x)
    dec %f
  }
  return %t
}

Comments

Sign in to comment.
DarthReven   -  Apr 04, 2005

Updated!

 Respond  
xDaeMoN   -  Mar 03, 2005

lol it is worth rating

 Respond  
Ace99   -  Mar 03, 2005

Please, next time submit something worth rating.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.