mIRC Homepage

Making /list not change window focus when used?

Posted By: xolademoness

Making /list not change window focus when used? - 06/04/05 10:12 PM

On a server I need to watch channels so I set up a timer to refresh the list, I have it not maximised so I can see notify, list and chat windows al at once.
I already worked out how to make it refresh automatically, using a timer
Code:
/timerList 0 30 /list


However the script is pretty annoying because whenever it refreshes the list of channels (with the numbers of people in each channel, the important part), every time it does that it grabs the focus of the window and so I have to click back on the text box each time if I want to type..
Extremely annoying if in the middle of typing something too smile

Was wondering if there's any way to refresh the list without it stopping you typing until you click back on the window you had selected before?
Thanks, if anyone can help it would be greatly appreciated, I've looked through the help files but can't find anything, maybe there's some way to get around that annoying grab-focus part of /list though...

Can anyone help please? confused
Posted By: SladeKraven

Re: Making /list not change window focus when used? - 07/04/05 06:19 AM

Indeed using a timer is a bit silly hehe, can't you just perform a /list using the Raw event for "End of /List"?
Posted By: xolademoness

Re: Making /list not change window focus when used - 07/04/05 01:20 PM

Quote:
Indeed using a timer is a bit silly hehe, can't you just perform a /list using the Raw event for "End of /List"?
I looked at the help and I don't understand it I think - how would that help?

The idea is that list will constantly refresh itself, that's why I wanted a timer to keep refreshing it automatically
- but whenever the timer performs /list it selects the window and stops me being able to type until I click back on the text box smirk
Posted By: SladeKraven

Re: Making /list not change window focus when used? - 07/04/05 01:20 PM

Its so you don't need a timer, what it does is performs the list, grabs all the channels and when it stops listing, it performs another list. Whilst mimimizing the window.

Code:
Raw 323:*: {
  list
  window -n "Channels List"
}


It's untested though. Just adding my oppinion.
Posted By: xolademoness

Re: Making /list not change window focus when used - 07/04/05 01:55 PM

that doesn't work very well smirk minimising means it isn't visible.. and it flickers between the white and grey background where the channel list is constantly as it keeps trying to relist and minimise it...

not really sure what to do, I tried looking for a -letter thing for the window command that would make a window but not activate it, letting you carry on whatever you're currently doing, but I can't find anything smirk
Posted By: MikeChat

Re: Making /list not change window focus when used - 07/04/05 04:58 PM

the real problem is mIRC wont let you stop the channel list (in v5.91 anyway)
Quote:

Get List
This retrieves a list of all of the active channels from the IRC server. This list can be quite long and depending on your connection it might take several minutes to download. The IRC Server actually sends the whole list, regardless of the filters you specify. You will not be able to do anything on IRC until this retrieval has been completed.

Posted By: SladeKraven

Re: Making /list not change window focus when used - 07/04/05 05:15 PM

Quote:

the real problem is mIRC wont let you stop the channel list (in v5.91 anyway)


Hehe, /list stop works in v6.16 not too sure about earlier releases though. smile
Posted By: MikeChat

Re: Making /list not change window focus when used - 07/04/05 06:02 PM

hmm of course stopping the list would defeat the whole thing..

I mucked about with the whole thing and mIRC doesnt let you stop the channels list window completely

also I still got an error msg (im a bit rusty) with the refocus on the active window, even though it did return focus to the window that was active ..
Code:
;;;; chanlist
raw 321:*:{ window -hn "Channels list" | window -a %active }
raw 322:*:{
  window -ls @chanlist 100 100 325 200
  aline @chanlist $2 $3
  halt
}
raw 323:*:{
  .timerrelist 0 15 chanrelist
  halt
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}
;;;;;;
Posted By: xolademoness

Re: Making /list not change window focus when used - 07/04/05 10:05 PM

Quote:
hmm of course stopping the list would defeat the whole thing..

I mucked about with the whole thing and mIRC doesnt let you stop the channels list window completely

also I still got an error msg (im a bit rusty) with the refocus on the active window, even though it did return focus to the window that was active ..
Code:
;;;; chanlist
raw 321:*:{ window -hn "Channels list" | window -a %active }
raw 322:*:{
  window -ls @chanlist 100 100 325 200
  aline @chanlist $2 $3
  halt
}
raw 323:*:{
  .timerrelist 0 15 chanrelist
  halt
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}
;;;;;;
that's pretty cool, it seems to work... However it then makes mirc grab focus even if I'm using another program at the time whenever it refreshes... and always goes back to a little square box however many times I resize it or use Position > save

also doesn't organise with the highest amount of users at the top which is quite important and missing the topics which I can do without I guess

not really sure what to do *sits on hands* crazy
Posted By: MikeChat

Re: Making /list not change window focus when used - 07/04/05 10:37 PM

However it then makes mirc grab focus even if I'm using another program at the time whenever it refreshes... and always goes back to a little square box however many times I resize it or use Position > save
This is beause its a custom window. The size is set in the line:
window -ls @chanlist 10 100 788 200


also doesn't organise with the highest amount of users at the top which is quite important and missing the topics which I can do without I guess
It is sorting in alphanumeric order, note change in this line:
aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-


not really sure what to do *sits on hands*
This is a common user error, place hands on the keyboard, type /help @window
or
/help /window
while mIRC is the active application

Code:
;;;; chanlist
raw 321:*: window -hn "Channels list" | if ($appactive == $true) { window -a %active }
raw 322:*:{
  window -ls @chanlist 10 100 788 200
  aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-
  halt
}
raw 323:*:{
  .timerrelist 0 15 chanrelist
  halt
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}
;;;;;;
Posted By: xolademoness

Re: Making /list not change window focus when used - 08/04/05 12:07 AM

Quote:
However it then makes mirc grab focus even if I'm using another program at the time whenever it refreshes... and always goes back to a little square box however many times I resize it or use Position > save
This is beause its a custom window. The size is set in the line:
window -ls @chanlist 10 100 788 200


also doesn't organise with the highest amount of users at the top which is quite important and missing the topics which I can do without I guess
It is sorting in alphanumeric order, note change in this line:
aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-


not really sure what to do *sits on hands*
This is a common user error, place hands on the keyboard, type /help @window
or
/help /window
while mIRC is the active application

Code:
;;;; chanlist
raw 321:*: window -hn "Channels list" | if ($appactive == $true) { window -a %active }
raw 322:*:{
  window -ls @chanlist 10 100 788 200
  aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-
  halt
}
raw 323:*:{
  .timerrelist 0 15 chanrelist
  halt
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}
;;;;;;
Ok, which bit controls how it displays.. I tried adding two dashes like " -- " between the end of the channel name and the start of the topic to make it a bit clearer and it messed up the order of it making the channels randomly listed (I guessed "aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-" is the bit that controls where it puts in the lines?)

also it still grabs focus for mIRC as a program every time it refreshes, for example it keeps doing it here while i type in firefox every time until i turned the script off and turned all timers off blush not sure how to get around that if the "if $activeprogram"-like thing doesn't actually work *ponder*
Posted By: MikeChat

Re: Making /list not change window focus when used - 09/04/05 04:52 PM

Ok, which bit controls how it displays..

window -ls @chanlist 10 100 788 200

tells mIRC to make a custom window 10 pixels from the left, 100 pixels down,
788 pixels wide and 200 pixels high

window -ls @chanlist 10 100 788 200
tells mIRC to sort the window



"aline @chanlist $right(... $+ $3,4) $2 $4-"

this adds a line to the window every time the server sends data

RAW data is prefixed and the prefix is in $1 which you dont need or want
$2 is the channel name
$3 is the number of users in the channel
$4 to $whatever will be the topic for that channel

in order to get the window to sort by the number of users in the channels
the order you want is $3 $2 $4-


also it still grabs focus for mIRC as a program every time it refreshes
this might be a version issue, what version of mIRC are you using?
Posted By: xolademoness

Re: Making /list not change window focus when used - 09/04/05 06:05 PM

Using the latest version, 6.16... (and Windows XP Home)

Ok, currently the script is
Quote:
Code:
;;;; chanlist
raw 321:*: window -hn "Channels list" | if ($appactive == $true) { window -a %active }
raw 322:*:{
window -ls @chanlist 10 100 788 200
aline @chanlist $right($str(.,4) $+ $3,4) $2 $4-
halt
}
raw 323:*:{
.timerrelist 0 540 chanrelist
halt
}
alias chanrelist {
set %active $active
clear @chanlist
list
}
;;;;;;


I tried putting the
@chanlist $right($str(.,4) $+ $3,4) $2 $4- bit like
@chanlist $right($str(.,4) $+ $3) $2 $4- but that made nothing show at all. It's already sorted by the amount of users but I would like the channels with the most amount of users to be at the top (like with normal /list) and not the bottom like the script currently sorts it... Not sure how to do this or if it's possible since the help file only says about -s for sort, not that you can actually change *how* it's sorted?

Whenever I do /list it also currently says
"Listing channels
-
* /window: invalid parameters
-
End of /List
-"
in status, not sure what is actually wrong in the above code


does anyone know if there's a quote character that you can use in mirc or something like that so it doesn't count as code? like I want to put a dash between the channel name and topic variables but it messes things up when I do
(also noticed in other things for example putting brackets around $time like [$time] or ($time) anything, it messes that up too)
Posted By: MikeChat

Re: Making /list not change window focus when used - 09/04/05 07:34 PM

I had hoped to resolve some of the basic issues first, but here is the latest:
Code:
;;;; chanlist
raw 321:*:{
  window -hn "Channels list" 
  if ($appactive == $true) { window -a %active }
  window -hls @chanlist1 
  window @chanlist 10 100 788 200
}
raw 322:*:{
  aline @chanlist1 $right(... $+ $3,4) - $2 - $4-
  halt
}
raw 323:*:{
  write -c @chanlist.txt
  savebuf @chanlist1 @chanlist.txt
  clear @chanlist1
  reversesort
  .timerrelist 0 50 chanrelist
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}

alias reversesort {
  var %clistlines = $lines(@chanlist.txt)
  while (%clistlines) {
    aline @chanlist $read -l $+ %clistlines @chanlist.txt
    dec %clistlines
  }
  sline @chanlist 10
}
;;;;;;


I did notice that if the Status window was the active window that it gave the error for /window but I did not see it if a channel window was the active window or if the custom @window was the active window.

This should now list the User count - channel name - topic (if any) in the largest to least order.

As far as the $appactive not working, it does work for me. That being said I did note that mIRC grabbed focus while I had notepad open, it should be noted that I opened notepad from inside mIRC, so that might have some effect. (shrug)
Posted By: MikeChat

Re: Making /list not change window focus when used - 09/04/05 07:46 PM

(also noticed in other things for example putting brackets around $time like [$time] or ($time) anything, it messes that up too)
This is because mIRC uses those same characters in the scripting language
try using the $chr(number of the character) $+ $time $+ $chr(number of the character)
fx:
$chr(91) $+ $time $+ $chr(93)
or
$+($chr(91), $time,$chr(93))
either way works in 6.16

Code:
alias chart {
  window -ado @ascii 6 93 386 245 
  var %i = 33
  while (%i <= 255) {
    if (%i <= 254) { 
      var %ii = %i + 1 
      var %iii = %i + 2
    }
    var %a = $right(00 $+ %i,4)
    if (%i <= 254) {
      var %aa = $right(00 $+ %ii,4)
      var %aaa = $right(00 $+ %iii,4)
    }
    if (%i <= 254) {
      aline @ascii $chr(36) $+ chr $+ $chr(40) $+ %a $+ $chr(41) = $chr(%a) $chr(36) $+ chr $+ $chr(40) $+ %aa $+ $chr(41) = $chr(%aa) $chr(36) $+ chr $+ $chr(40) $+ %aaa $+ $chr(41) = $chr(%aaa)
    }
    if (%i == 255) {
      aline @ascii $chr(36) $+ chr $+ $chr(40) $+ %a $+ $chr(41) = $chr(%a) 
    }
    var %i = %i + 3
  }
}
Posted By: xolademoness

Re: Making /list not change window focus when used - 21/04/05 10:18 PM

Quote:
I had hoped to resolve some of the basic issues first, but here is the latest:
Code:
;;;; chanlist
raw 321:*:{
  window -hn "Channels list" 
  if ($appactive == $true) { window -a %active }
  window -hls @chanlist1 
  window @chanlist 10 100 788 200
}
raw 322:*:{
  aline @chanlist1 $right(... $+ $3,4) - $2 - $4-
  halt
}
raw 323:*:{
  write -c @chanlist.txt
  savebuf @chanlist1 @chanlist.txt
  clear @chanlist1
  reversesort
  .timerrelist 0 50 chanrelist
}
alias chanrelist {
  set %active $active
  clear @chanlist
  list
}

alias reversesort {
  var %clistlines = $lines(@chanlist.txt)
  while (%clistlines) {
    aline @chanlist $read -l $+ %clistlines @chanlist.txt
    dec %clistlines
  }
  sline @chanlist 10
}
;;;;;;


I did notice that if the Status window was the active window that it gave the error for /window but I did not see it if a channel window was the active window or if the custom @window was the active window.

This should now list the User count - channel name - topic (if any) in the largest to least order.

As far as the $appactive not working, it does work for me. That being said I did note that mIRC grabbed focus while I had notepad open, it should be noted that I opened notepad from inside mIRC, so that might have some effect. (shrug)


That is really great, thank you.. the chart looks like it will be useful for the future too, definitely! Thanks!!!

I was wondering, how would I set that timer up so it went off at random intervals between a certain amount of seconds? e.g. between 60 to 120 seconds, a different interval each time?

If you can help, or anyone else can help too, it would be greatly appreciated.. I have tried looking at other scripts that do random times but just can't figure it out frown confused
Posted By: MikeChat

Re: Making /list not change window focus when used - 22/04/05 02:17 AM

in the script it has this timer
.timerrelist 0 50 chanrelist

replace it with
.timerrelist 0[color:red] $r(60,120)[color:blue] chanrelist [/color] [/color]

that would be random between 60 to 120 seconds
Posted By: SladeKraven

Re: Making /list not change window focus when used - 22/04/05 11:38 AM

Lets assume the randomized number is 65, 65 will always be the number of seconds it takes before it issues the command.
Posted By: xolademoness

Re: Making /list not change window focus when used - 22/04/05 02:03 PM

Oh hm.. so need a way to make it make a new random number
for the variable each time..
maybe if it deleted the variable then remade it?
Or something..
Posted By: MikeChat

Re: Making /list not change window focus when used - 22/04/05 03:17 PM

I seem to have missed a digit:

This should be random

raw 323:*:{
write -c @chanlist.txt
savebuf @chanlist1 @chanlist.txt
clear @chanlist1
reversesort
.timerrelist 1 $r(60,120) chanrelist
}
Posted By: MikeChat

Re: Making /list not change window focus when used - 22/04/05 03:52 PM

ok, made some other changes:
Code:
;;;; chanlist
#chanlist on
raw 321:*:{
  window -hn "Channels list"
 [color:red] if ($appactive == $true) { 
    if ($window(%active).type == channel) { window -a %active }
  }[/color]
[color:blue] ;;; only sets focus if a channel window was $active[/color]

  window -hls @chanlist1 
  window @chanlist 10 100 788 200
}
raw 322:*:{
  aline @chanlist1 $right(... $+ $3,4) - $2 - $4-
  halt
}
raw 323:*:{
   [color:red]set %showtime $ctime[/color]
[color:blue];;; settup to show the delay, remove if you dont want this (as well as the line below that has $duration in it) [/color]


  write -c @chanlist.txt
  savebuf @chanlist1 @chanlist.txt
  clear @chanlist1
  reversesort
 [color:red] .timerrelist 1 $r(60,120) chanrelist [/color]
}

alias chanrelist {
  [color:red] echo -s $duration($calc($ctime - %showtime))[/color]
[color:blue];;;; this shows what the delay was in status, remove this with the settup above if you dont want to see the delay[/color]

  set %active $active
  clear @chanlist
  list
}

alias reversesort {
  var %clistlines = $lines(@chanlist.txt)
  while (%clistlines) {
    aline @chanlist $read -l $+ %clistlines @chanlist.txt
    dec %clistlines
  }
  sline @chanlist 10
}
;;;;;;
#chanlist end
Posted By: xolademoness

Re: Making /list not change window focus when used - 22/04/05 04:50 PM

Fantastic smile Seems to be working ok now!

One thing though, is there any way to remove the big
white space at the top of the window the script makes?
Each time it refreshes it moves the scroll bar of the
window so hides some text sometimes, meaning I have
to click on it and readjust it if I want to see the channel
with the most people in it confused
Posted By: MikeChat

Re: Making /list not change window focus when used - 22/04/05 04:59 PM

this line trys to do that
Code:
alias reversesort {
  var %clistlines = $lines(@chanlist.txt)
  while (%clistlines) {
    aline @chanlist $read -l $+ %clistlines @chanlist.txt
    dec %clistlines
  }
 [color:red] sline @chanlist 10[/color]
}


the font that you are using will change whether that works well or not.
change the 10 to 8 or whatever to get it to show the top line
Posted By: xolademoness

Re: Making /list not change window focus when used - 22/04/05 05:11 PM

Ok changing the 10 to 8 seems to have worked. smile
Still that mysterious white space there, what causes
that? Not important it's just odd

Also is there any way to stop the mirc window
flashing when the list is automatically updated?

I like mirc flashing when new text is in the channel
I am in etc, that is what I have it set to do and I like
that, but it's a bit confusing now it flashes too when
the list updates, giving me a "false alarm" thinking
people are talking when they're not smirk confused
Posted By: MikeChat

Re: Making /list not change window focus when used - 22/04/05 05:19 PM

Not that I could find.
Posted By: xolademoness

Re: Making /list not change window focus when used - 22/04/05 05:32 PM

Ok thanks for everything else though, was really nice of
you to help.. smile smile Other than that it works great! I still
haven't figured out what causes the big white space though
looking at it I thought it would be like "... - - " on every line
that is blank there instead.

If anyone else knows by any chance how to make it so it
doesn't flash the mIRC window on my taskbar when the
script updates the list please reply? confused
© 2021 mIRC Discussion Forums