mIRC Homepage
Posted By: Exuviax Unable to Read from File - 07/10/14 01:09 AM
I have tried everything!

I can't get

Code:
on *:text:!dc *:#: {
  msg # Death Count: $2
  write -c C:\Users\Randy\Desktop\mirc $2
}
on *:text:!death:#: {
  var %cow $read(C:\Users\Randy\Desktop\mirc\death.txt.) 
  msg # Death Count: %cow
}


I can not get the !death to work,
It just says "Death count:"


Actually, now that I got you here. What I really wanted was something like this

Code:
on *:text:!dc *:#: {
  var %death %read(C:\Users\Randy\Desktop\mirc\death.txt)
  var inch %death
  msg # Death Count: %death
  write -c C:\Users\Randy\Desktop\mirc\death.txt %death
}



But this won't count past 2.
Posted By: Wims Re: Unable to Read from File - 07/10/14 01:17 AM
The first on text event/write is missing the filename on the /write command

On the second event, you have a dot at the end of the path in $read()

If you want to increase a counter, you don't need to use a text file for that, use a global variable:
Code:
on *:text:!dc &:#: {
 ;the & above makes sure $2 (the second word) is filled
  inc %death
  msg # Death Count: %death
}
© mIRC Discussion Forums