mIRC Home    About    Download    Register    News    Help

Print Thread
new switch for /sockopen #222601 26/06/10 01:34 AM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
I think having a switch that automatically close a connexion before trying to open it for /sockopen would be a good idea, same for /socklisten


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: new switch for /sockopen [Re: Wims] #222604 26/06/10 08:25 AM
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
How about:

Code:
alias sockopen {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | sockopen $1-
  elseif $sock($1) != $null sockclose $1 | sockopen $1-
}

alias socklisten {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | socklisten $1-
  elseif $sock($1) != $null sockclose $1 | socklisten $1-
}


That would make sure whenever you try to open an existing sock, that sock will be closed first, then opened-anew.

Good luck,
ziv.

Re: new switch for /sockopen [Re: ziv] #222609 26/06/10 12:19 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Yeah, and almost anyone could write is own code for the suggestion he is making, the point is that this one is over-used, I'm pretty sure that 99% of the time, people just do /sockclose name | sockopen name ip port, which is fine, but it would make a lot of sense to have this built-in


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: new switch for /sockopen [Re: Wims] #222610 26/06/10 03:23 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I always thought that a socket would close by itself when its task was completed.

Re: new switch for /sockopen [Re: Tomao] #222611 26/06/10 04:27 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Well, a socket never close itself afaik, it's either you or the person you're connected to that close it, but I guess losing the internet connexion is also a way.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: new switch for /sockopen [Re: Wims] #222612 26/06/10 04:53 PM
Joined: Nov 2004
Posts: 826
Jigsy Offline
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
I second this.


What do you do at the end of the world? Are you busy? Will you save us?
Re: new switch for /sockopen [Re: Wims] #222614 26/06/10 06:13 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: Wims
I guess losing the internet connexion is also a way.
You never lose your sense of whimsicality :P