Here's a slight rewrite for you.

Code:
output {
  set %file $+(C:\Westwood\RenegadeFDS\Server\renlog_,$date(m-d-yyyy),.txt)
  set %lines $lines(%file)
  if (%lines >= 4) {
    set %readline $calc(%lines - 2)
    readlog
  }
  else {
    set %readline 0
    readlog
  }
}
readlog {
  if (%readline != $calc(%lines + 1)) {
    set %readtext $remove($read(%file,%readline),$1)
    msg %normalchannel 4[RR] $remove(%readtext,[ $+ [ $1 ] ])
    set %lines $lines(%file)
    inc %readline
    checklines
  }
  else {
    checklines
  }
}
checklines {
  if (%readline == $calc(%lines + 1)) {
    checklines2
  }
  else {
    readlog
  }
}
checklines2 {
  if (%readline == $calc(%lines + 1)) {
    .timerchecklines 0 0.1 checkfinal
  }
  else {
    readlog
  }
}
checkfinal {
  if (%readline == $calc(%lines + 1)) {
    set %lines $lines(%file)
  }
  else {
    .timerchecklines off
    readlog
  }
}


A couple of things...

Code:
readlog {
  if (%readline != $calc(%lines + 1)) {
    set %readtext $remove($read(%file,%readline),$1)
    msg %normalchannel 4[RR] $remove(%readtext,[ $+ [ $1 ] ])
    set %lines $lines(%file)
    inc %readline
    checklines
  }


All of your /readlog commands do not include a $1. So I'm unsure why you're using $1 here unless you also call the alias manually or from some other script not shown here. Also, why are you removing $1 twice from it? Once would be enough. I left those lines as they were so you could decide what you wanted to do with them.

Another thing... this readlog alias sets the %lines variable inside the IF statement that already checks the %lines variable. If it wasn't already set to $lines(%file) before the IF statement, then it wouldn't be checking it correctly. You would be better off having that /set command before the IF.

Also, unless you need to store every variable, you can use /var for some of these. From what you're showing here, you don't need a variable such as %readtext except while inside the alias, for example. For any variables that the /set, you should make sure that they are unique. A variable such as %lines could be used by other scripts you may want to install and that could cause a conflict. Try using variables such as %log.lines or something more unique for any /set variables. /var variables don't matter because they are used only in that one script and then get unset.

I'm also unsure why you're looping through the log the way you are. There are a couple of better choices for doing so... /play would probably be the best. And, if not /play, then WHILE would be good in the readlog alias.


Invision Support
#Invision on irc.irchighway.net