mIRC Homepage
Posted By: Confuzzled need help with log player - 30/01/06 08:03 PM
this use to work before, but somehow it stopped working i don't know why, can anyone help?
Code:
On 187:text:$($me readlog*):#: {
  unset %playlog.cnt
  var %starting.position = 1
  var %starting.position = $4
  play -af $+ %starting.position playlog $chan $mircdirlogs\ $+ $3 900
}
alias playlog {
  inc %playlog.cnt
  msg $1-
  if (%playlog.cnt >= 20) { play stop | unset %playlog.cnt }
}


when i type MyBotNick readlog #logname.log <number of line to start from> it don't work but when i only type MyBotNick readlog #logname.log it works sometimes, sometimes don't
Posted By: MikeChat Re: need help with log player - 30/01/06 10:27 PM
Quote:

Code:
On 187:text:$($me readlog*):#: {
  unset %playlog.cnt
  var %starting.position = 1
  var %starting.position = $4
  play -af $+ %starting.position playlog $chan $mircdirlogs\ $+ $3 900
}
alias playlog {
  inc %playlog.cnt
  msg $1-
  if (%playlog.cnt &gt;= 20) { play stop | unset %playlog.cnt }
}


I dont know why you had a value being put in %starting.position twice
my guess was you wanted a default value
":$($me readlog<space>*) I think you need that as a space unless the filename is directly appended to the text "readlog"

Code:
On 187:text:$($me readlog *):#: {
  unset %playlog.cnt
  var %starting.position = $4
  if (!%starting.position) { var %starting.position = 1 }
  play -af $+ %starting.position playlog $chan $mircdirlogs\ $+ $3 900
}

I dont know what this is, it isnt used in the rest of the code you posted, 
other than the var being unset
alias playlog {
  inc %playlog.cnt
  msg $1-
  if (%playlog.cnt &gt;= 20) { play stop | unset %playlog.cnt }

$logdir - Returns the Logs directory as specified in the Logging section of the Options dialog.
© mIRC Discussion Forums