mIRC Home    About    Download    Register    News    Help

Print Thread
#100750 16/10/04 02:51 AM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
If my tcp socket is already connected to a network how would i let it connect to another one along with the one I am already on. Do sockets have multiserver capabilty like we do ?

#100751 16/10/04 03:00 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Just open a new socket.


New username: hixxy
#100752 16/10/04 03:13 AM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
I see people connecting there bots to serveral different networks at once. They type a command like .server <servername> -j #channel and it connects.

So would this mean they are opening a new socket or is that socket using the same one its already on?

#100753 16/10/04 03:30 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
They're opening a new socket. A socket can only have a single source and a single destination. When you connect to a new server with mIRC it creates a new socket internally.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#100754 16/10/04 03:31 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
New socket.

Here's an example:

Code:
on *:sockopen:bot*:{
  &lt;stuff you want to do when connecting&gt;
}
on *:sockread:bot*:{
  var %s
  sockread %s
  tokenize 32 %s
  if ($level($right($1,-1)) == botowner) { 
    if ($right($4,-1) == .server) { 
      if ($5 != -m) { 
        var %name = $sockname
        sockclose %name
        sockopen %name $5 $iif($6,$6,6667)
      }
      elseif ($5 == -m) { sockopen $+(bot,$rand(1,$str(9,10))) $6 $iif($7,$7,6667) }
    }
  }
}


New username: hixxy
#100755 17/10/04 10:24 AM
Joined: Mar 2004
Posts: 130
T
Vogon poet
Offline
Vogon poet
T
Joined: Mar 2004
Posts: 130
LOL


Link Copied to Clipboard