mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2005
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: May 2005
Posts: 2
Can anyone help me on this please? I tried it this way:
The script should replace the first word if it is a nick and if it has a : as the most right character.
Code:
alias acronymreplacer {
  if ($findtok($3-,$1,1,32)) {
    var %text = $3-
    while ($findtok(%text,$1,1,32)) {
      if (c isin $chan(#).mode) {
        var %text =  $strip($reptok(%text,$1,$2,32))
      }
      else { 
        var %text =  $reptok(%text,$1,$2,32)
      }
    }
    return %text
  }
  return $3-
}
alias thema {
  var %i = 1, %m = $numtok($1-, 32), %w, %result
  while (%i <= %m) {
    %w = $gettok($1-, %i, 32)
    %result = $+( %result  , $base(%color1,10,10,2) , $left(%w,1) ,  , $base(%color2,10,10,2) , $right(%w,-1) )
    inc %i
  }
  if ($isid) { return $+(%result, ) }
}

#LazyBoy on
on 1:input:*: {
  if ($left($1,1) != $chr(47)) {
    var %text = $1-
 [color:blue] 
    if ($right($1,1) == :) {
      var %i = 1
      while ($nick($chan,%i)) {
        if ($replace($1,:,*) iswm $nick($chan,%i)) {
          var %text = $acronymreplacer($nick($chan,%i),$thema(%leftborder $+ $nick($chan,%i)) $+ %rightborder,%text)
          goto nextstep
        }
        inc %i
      }
    }
    :nextstep
[/color]
    var %text = $acronymreplacer(lol,$thema(Laughing Out Loud),%text)
[color:red]    [...]  [/color] 
    msg $active %text
    halt
  }
  #LazyBoy end


The acronyms are replaced correctly (of course) but it doesn't change the nick.
Any help is welcome.

SchwarzeSeele

Last edited by SchwarzeSeele; 30/05/05 06:10 PM.
Joined: May 2005
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: May 2005
Posts: 2
Got it!
Code:
 [color:blue]
    if (*: iswm $1) {
      var %i = 1
      while ($nick($chan,%i)) {
        if ($replace($1,:,*) iswm $nick($chan,%i)) {
          var %text = $acronymreplacer($1,%leftborder $thema($nick($chan,%i)) %rightborder,%text)
        }
        inc %i
      }
    }

 [/color]
 


This instead of the old blue text works for me laugh


Link Copied to Clipboard