mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
is there a way to do it?

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
To close all GET/SEND..


/closegetall
/closesendall


Code:
alias closegetall {
  var %x = $get(0)
  while (%x) {
    close -g$get(%x)
    dec %x
  }
}

alias closesendall {
  var %x = $send(0)
  while (%x) {
    close -s$send(%x)
    dec %x
  }
}


To close specific GET/SEND..


/closeget 1
/closesend 1

Code:
alias closeget {
  if ($get($1)) { close -g$1 } 
}

alias closesend {
  if ($send($1)) { close -s$1 } 
}

Last edited by SladeKraven; 14/03/05 03:51 AM.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
that doesnt work -g$1 closes all gets.

Code:
;
; CLOSEGET/SEND FORMAT N / nick,[N]
;  N = get/send number to close
;   or
;  nick = nick of get(s)/send(s) to close
;  N = specific nicks get/send number to close, no N value deemed to close all nicks gets/sends
;
alias closeget {
  if (!$2) { 
    if ($1 isnum) { close -g $+ $1 }
    else { while ($get($1,1)) { window -c "Get $1 $get($1,1).file $+ " } }
  }
  elseif ($get($1,$2) == $1) { window -c "Get $1 $get($1,$2).file $+ " }
}
alias closesend {
  if (!$2) { 
    if ($1 isnum) { close -s $+ $1 }
    else { while ($send($1,1)) { window -c "Send $1 $get($1,1).file $+ " } }
  }
  elseif ($send($1,$2) == $1) { window -c "Send $1 $send($1,$2).file $+ " }
}

Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
thanks for that dave, but i've been using your code for a while and noticed an error with it

when a filename includes the character ' ($chr(39)), it stuffs up and doesnt close it.

eg. /window -c "Send nickname something'with'chr39.mp3"

but /close -g# is perfect for what i'm doing
thank you both!

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Yeah its a copying typo, I didnt actually write the closesend alias i copied it from the closeget alias.

it should read as follows *** note the corrected line 4 ***

Code:
alias closesend {
  if (!$2) { 
    if ($1 isnum) { close -s $+ $1 }
    else { while ($send($1,1)) { window -c "Send $1 $send($1,1).file $+ " } }
  }
  elseif ($send($1,$2) == $1) { window -c "Send $1 $send($1,$2).file $+ " }
}


Beyond this which may have been what was causing the close failure, I have had no problem with it closing any send or get with ' in it.


Link Copied to Clipboard