mIRC Homepage
Posted By: Ravelux cant find read-error - 20/05/15 06:40 AM
I can't find my fail in my command. Can you help me?

command
Code:
on *:text:!subs:#:{
  if ($nick == ravelux) {
    var %read $read(subcount.txt,n)
    msg $chan Test: %read
    else {
    msg $nick Nope! }
  }
}


subcount.txt
Code:
232
Posted By: KindOne Re: cant find read-error - 20/05/15 08:14 AM
One issue I see, is you need to move an } that is after the else, to before it.

Code:
on *:text:!subs:#:{
  if ($nick == ravelux) {
    var %read $read(subcount.txt,n)
    msg $chan Test: %read
  }
  else { msg $nick Nope! }
}


Notice how the if/else line up now? I assume this is the issue you are having, unless you have some other issue?

Posted By: splinny Re: cant find read-error - 20/05/15 08:41 AM
"(subcount.txt,n)" - N is a letter, not a line number.
Posted By: Ravelux Re: cant find read-error - 20/05/15 10:41 AM
I tried it in different ways. I tried it with:
"(subcount.txt,n)"
"(subcount.txt,1)"
"(subcount.txt)"

Nothing worked
Posted By: splinny Re: cant find read-error - 20/05/15 10:50 AM
Place this on-text on top of your remotes, type in mIRC editbox (IN CHAT) /write -c subcount.txt test
(old subcount.txt will be DELETED).
Posted By: Ravelux Re: cant find read-error - 20/05/15 11:07 AM
To clarify:
subcount.txt gets created via a vbs file. So there is just one number in this file.
And this file should get imported into variable %subcounter.
Posted By: Loki12583 Re: cant find read-error - 20/05/15 11:12 AM
Quote:
If the first line in the file is a number, it must represent the total number of lines in the file. If you specify N = 0, mIRC returns the value of the first line if it is a number.



If the t switch is specified then mIRC will treat the first line in the file as plain text, even if it is a number.
Posted By: Ravelux Re: cant find read-error - 20/05/15 02:59 PM
Okay, that t fixed my problem.
I have another problem now.

The command includes now 'run subcount.vbs' but I need to run it twice to get the correct number of the file. I think the processes happen too fast.
Posted By: sparta Re: cant find read-error - 21/05/15 02:18 PM
If you try run it with a timer?
Posted By: Ravelux Re: cant find read-error - 22/05/15 05:36 AM
If I use it with a timer then I get no number from the file so it just say 'We currently have Subscriber' instead of 'We currently have 230 Subscriber'
© mIRC Discussion Forums