|
Joined: Jul 2008
Posts: 57
Babel fish
|
OP
Babel fish
Joined: Jul 2008
Posts: 57 |
hi all I use this as my acronym addon. alias REG_ACRO {
VAR %REG_ACRO_INPUT $1-, %REG_ACRO_TOK $HGET(REG_ACRO_TABLE,0).DATA, %REG_ACRO_TEMP, %REG_ACRO_OUTPUT
WHILE (%REG_ACRO_TOK) {
IF ($REGEX(REG_ACRO_EX,%REG_ACRO_INPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig))) {
%REG_ACRO_TEMP = $REGSUB(%REG_ACRO_INPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).DATA,%REG_ACRO_OUTPUT)
%REG_ACRO_TEMP = $REGSUB(%REG_ACRO_OUTPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).DATA,%REG_ACRO_INPUT)
}
DEC %REG_ACRO_TOK
}
TOKENIZE 32 $IIF(%REG_ACRO_OUTPUT,$v1,%REG_ACRO_INPUT)
RETURN $+($UPPER($LEFT($1,1)),$MID($1-,2))
} what i can't get working is when i type this  i think it has something to to with the : what works is :p if i use it without space to a word like: word:p else it doesn't work anyine any idea? all credits for this addon go to DarthReven on hawkee.
|
|
|
|
Joined: Jul 2006
Posts: 4,020
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,020 |
alias reg_acro {
var -p %p $1-
noop $hfind(reg_acro_table,*,0,w,%p = $regsubex(%p,$+(/\b\Q,$replacecs($1,\E,\E\\E\Q),\E\b/),$hget(reg_acro_table,$1)))
return $+($upper($left(%p,1)),$mid(%p,2))
} Not tested but should work. The original code had several issue and was poorly performing, this fix the issue and is also much faster, you need one of the latest mIRC version.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jul 2008
Posts: 57
Babel fish
|
OP
Babel fish
Joined: Jul 2008
Posts: 57 |
thanks but ...... on everything i type not starting with a smiley the first word doesn't shows up.
|
|
|
|
Joined: Jul 2006
Posts: 4,020
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,020 |
Right, my bad, $regsubex is eating the $N- tokens, I thought it was only doing so when the subtext contains special markers, but it always does it, using $regsub works better then: alias reg_acro {
var -p %p $1-
noop $hfind(reg_acro_table,*,0,w,noop $regsub(%p,$+(/\b\Q,$replacecs($1,\E,\E\\E\Q),\E\b/),$hget(reg_acro_table, $1),%p))
return $+($upper($left(%p,1)),$mid(%p,2))
}
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
|