mIRC Homepage
Posted By: ots654685 Mark all read script - 21/11/09 05:38 PM
Any1 can help me making a "mark all read" and "close all query" script ?

I had some in the past but for some reason it wont work anymore

alias markread {
/scon -a markread.single
}

alias markread.single {
var %i = $window(*,0)
while (%i) {
window -g0 $qt($window(*,%i))
dec %i
}
}

That is what i have but it doesn't work for some reason
Posted By: Horstl Re: Mark all read script - 22/11/09 02:11 AM
The code itself is working for me... Do you get any error message? Can you confirm the code is executing at all, that is: does mIRC print all the commands if you replace the "window -g0"-line with
Code:
echo -s window -g0 $qt($window(*,%i))
?
Posted By: ots654685 Re: Mark all read script - 22/11/09 11:13 AM
I don't get any error msg and adding ecgo in front of it does'n't give any output.
What i did was put another echo after it and my screen got floaded so it's reaching that point just not performing what it should do.
Posted By: 5618 Re: Mark all read script - 22/11/09 03:57 PM
Have you perhaps added a customs alias called window?

You can test this by changing the window command to !window
Posted By: Horstl Re: Mark all read script - 22/11/09 04:01 PM
It should have listed all /window-commands at the respective status windows... weird.
What's the return of
Code:
//echo -a $isalias(window) $isalias(scon)
? Can you show us your complete debugging code (including the echo command)?
Posted By: s00p Re: Mark all read script - 24/11/09 08:12 AM
What is the result of the following?

Code:
//echo -a $window(*,0)
Posted By: Horstl Re: Mark all read script - 24/11/09 10:46 AM
Would you kindly inform us what new surmise this question implies?
Posted By: westor Re: Mark all read script - 26/11/09 12:01 PM
Also if this will help you try this:

Code:
alias markread {
  var %i = 1
  while ($window(*,%i).wid) {
    window -g0 @ $+ $v1
    inc %i
  }
}
alias f2 scon -a markread


And for closing all the query windows just type : /closemsg
Posted By: s00p Re: Mark all read script - 29/11/09 07:47 AM
Horstl, I already know that $window can't be overridden by custom aliases (though /window can). That was a response to your request that they "try this"... advice containing those two words often isn't particularly useful advice. What was the point of your question?

To be clear and concise:
Code:
echo -s window -g0 $qt($window(*,%i))

Would result in a correct return value, regardless of a "custom alias", providing %i evaluates to a numeric value >= 0 and <= $window(*,0).

Originally Posted By: westor
Also if this will help you try this:

Code:
alias markread {
  var %i = 1
  while ($window(*,%i).wid) {
    window -g0 @ $+ $v1
    inc %i
  }
}
alias f2 scon -a markread


And for closing all the query windows just type : /closemsg

Thankyou for teaching me something undocumented. How did you come about learning this?
Posted By: westor Re: Mark all read script - 29/11/09 12:15 PM
I had just used /HELP command laugh
Posted By: Horstl Re: Mark all read script - 29/11/09 02:44 PM
Originally Posted By: s00p
(...) That was a response to your request that they "try this"... advice containing those two words often isn't particularly useful advice. What was the point of your question?
My main question was: to see the actual code (i.e. the place of the echo that does trigger, to exclude the posibility of duplicate aliases causing the problem...). Who added another redundant "try this"-post? whistle
Originally Posted By: s00p
To be clear and concise:
Code:
echo -s window -g0 $qt($window(*,%i))

Would result in a correct return value, regardless of a "custom alias", providing %i evaluates to a numeric value >= 0 and <= $window(*,0).
This part might not trigger at all if a custom /scon or a duplicate alias is called. It was the point of my first question to verify this.

Also note that most likely the OP did fix the script by now.
*sigh

© mIRC Discussion Forums