mIRC Home    About    Download    Register    News    Help

Print Thread
Mark all read script #216602 21/11/09 05:38 PM
Joined: Feb 2006
Posts: 97
O
ots654685 Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Feb 2006
Posts: 97
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

Last edited by ots654685; 21/11/09 06:04 PM.
Re: Mark all read script [Re: ots654685] #216612 22/11/09 02:11 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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))
?

Re: Mark all read script [Re: Horstl] #216615 22/11/09 11:13 AM
Joined: Feb 2006
Posts: 97
O
ots654685 Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Feb 2006
Posts: 97
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.

Re: Mark all read script [Re: ots654685] #216618 22/11/09 03:57 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Have you perhaps added a customs alias called window?

You can test this by changing the window command to !window

Re: Mark all read script [Re: ots654685] #216620 22/11/09 04:01 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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)?

Re: Mark all read script [Re: Horstl] #216651 24/11/09 08:12 AM
Joined: Jul 2008
Posts: 236
S
s00p Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
What is the result of the following?

Code:
//echo -a $window(*,0)

Re: Mark all read script [Re: s00p] #216657 24/11/09 10:46 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Would you kindly inform us what new surmise this question implies?

Re: Mark all read script [Re: Horstl] #216688 26/11/09 12:01 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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

Last edited by westor; 26/11/09 12:03 PM.
Re: Mark all read script [Re: Horstl] #216723 29/11/09 07:47 AM
Joined: Jul 2008
Posts: 236
S
s00p Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
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?

Last edited by s00p; 29/11/09 07:58 AM.
Re: Mark all read script [Re: s00p] #216726 29/11/09 12:15 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
I had just used /HELP command laugh

Re: Mark all read script [Re: s00p] #216731 29/11/09 02:44 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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


Last edited by Horstl; 29/11/09 02:47 PM.