mIRC Home    About    Download    Register    News    Help

Print Thread
#252987 20/05/15 06:40 AM
R
Ravelux
Ravelux
R
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

Last edited by Ravelux; 20/05/15 06:42 AM.
#252988 20/05/15 08:14 AM
Joined: Feb 2011
Posts: 472
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 472
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?


Last edited by KindOne; 20/05/15 08:18 AM. Reason: more clear description
Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
"(subcount.txt,n)" - N is a letter, not a line number.

R
Ravelux
Ravelux
R
I tried it in different ways. I tried it with:
"(subcount.txt,n)"
"(subcount.txt,1)"
"(subcount.txt)"

Nothing worked

#252991 20/05/15 10:50 AM
Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
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).

R
Ravelux
Ravelux
R
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.

#252993 20/05/15 11:12 AM
Joined: Jan 2004
Posts: 1,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
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.

R
Ravelux
Ravelux
R
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.

#253016 21/05/15 02:18 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
If you try run it with a timer?

R
Ravelux
Ravelux
R
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'


Link Copied to Clipboard