mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Indeed using a timer is a bit silly hehe, can't you just perform a /list using the Raw event for "End of /List"?

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.


Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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
}
;;;;;;

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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
}
;;;;;;

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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*

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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?

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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)

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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)

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
(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
  }
}

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Lets assume the randomized number is 65, 65 will always be the number of seconds it takes before it issues the command.

Joined: Feb 2005
Posts: 40
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2005
Posts: 40
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..

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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
}

Page 1 of 2 1 2

Link Copied to Clipboard