mIRC Home    About    Download    Register    News    Help

Print Thread
#252987 20/05/15 06:40 AM
Joined: Mar 2015
Posts: 19
R
Ravelux Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Mar 2015
Posts: 19
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.
Joined: Feb 2011
Posts: 451
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 451
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: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
"(subcount.txt,n)" - N is a letter, not a line number.


Dont give a fish - teach to fish!
Joined: Mar 2015
Posts: 19
R
Ravelux Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Mar 2015
Posts: 19
I tried it in different ways. I tried it with:
"(subcount.txt,n)"
"(subcount.txt,1)"
"(subcount.txt)"

Nothing worked

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
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).


Dont give a fish - teach to fish!
Joined: Mar 2015
Posts: 19
R
Ravelux Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Mar 2015
Posts: 19
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.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Mar 2015
Posts: 19
R
Ravelux Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Mar 2015
Posts: 19
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.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
If you try run it with a timer?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2015
Posts: 19
R
Ravelux Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Mar 2015
Posts: 19
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