mIRC Home    About    Download    Register    News    Help

Print Thread
#86345 11/06/04 01:52 AM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
Im trying to find a way to show just all the open PM message windows. Im making it a ctcp command this is what i have so far "ctcp 1:whois:*:/msg $nick I am talking to" easy enough so far. but I dont know how to show all the PM windows. heres a better discription. Say im taking to joe,tim,tom,and dick and someone ctcps me saying whois it whould show them "I am talking to Joe, tim, tom, dick". Does anyone know how to do this?


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }
Joined: Dec 2002
Posts: 397
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
something kinda like this
Code:
ctcp 1:whois:*: {
   var %total = $query(0)
   var %a = 1
   while (%a <= %total) {
    set %names %names $+ , $query(%a)
    inc %a 1
  }
  /notice $nick I am talking to: %names
}


Need amazing web design for low price: http://www.matrixn3t.net
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Well, one way would be to loop through all open PM windows (all those you want to count) and add all the nicknames to a variable list. So, sake of argument (just for example and TOTALLY UNTESTED):

Code:
ctcp *:whois:*: {
  var %window.nix = $window(0)
  :start
  if (%window.nix == 0) { msg $nick I am talking to %PM.nicks | halt }
  if (($window(%window.nix).type == query) || ($window(%window.nix).type == chat)) { var %PM.nicks = $window(%window.nix) $+ , }
  dec %window.nix | goto start
}


Mind you, people will show you a while loop and offer that as at least one alternative (not to mention making the code a lot better/faster/shorter). Again, this is just a single way it could be done


LOL Atma, beat me to it smile

Last edited by landonsandor; 11/06/04 03:20 AM.

Those who fail history are doomed to repeat it
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
well ATMA method worked but yours dident for some reason. All i got was I am talking to and after that it was all blank.


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
no problem, as I said, mine was untested. The important thing is you got what you needed smile


Those who fail history are doomed to repeat it
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
lol thanks.


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
small problem with the
Code:
 ctcp 1:whois:*: {
  var %total = $query(0)
  var %a = 1
  while (%a <= %total) {
    set %names %names $+ , $query(%a)
    inc %a 1
  }
  /notice $nick I am talking to: %names
} 


it shows it right the first time then it goes "I am talking to person 1, person 2, person 1, person 2
and it gets longer each time.


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Like i said on a different site:

Code:
ctcp *:whois:*:{ 
  var %i = 1, %nicks 
  while $query(%i) { 
    %nicks = %nicks $+ , $ifmatch 
    inc %i 
  } 
  msg $nick I am talking to $right(%nicks,-1) 
} 


New username: hixxy
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
o jeez i forgot about the other site ><;; sorry about that thanks alot.


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }

Link Copied to Clipboard