Project

General

Profile

Sockopen » History » Version 1

Per Amundsen, 02/15/2014 07:21 PM

1 1 Per Amundsen
_Added in 1.8.10_
2
3
*/sockopen [-de] [bindip] <name> <address> <port>*
4
5
*Switches*
6
7
-d - The specified IP address is the bind ip address.
8
-e - Creates an SSL connection.
9
10
*Parameters*
11
12
[bindip] - Bind ip to be used.
13
<name> - Socket connection name.
14
<address> - Remote ip address to connect to.
15
<port> - Remote port to connect to.
16
17
*Example*
18
19
<pre>
20
alias example {
21
  ;Initiate a connection with "irc.freenode.org" on port 6669, Secured connection.
22
  /sockopen -e IRC irc.freenode.org +6697
23
}
24
 
25
on *:sockopen:IRC:{
26
  ;Send our USER and NICK irc commands.
27
  /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf
28
  /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf
29
}
30
 
31
;Show all receiving data in a window.
32
on *:sockread:IRC:{
33
  /window -de @IRC
34
  /var %x
35
  /sockread %x
36
  /aline -p @IRC $iif(%x,$v1,-)
37
}
38
</pre>