Sockopen » History » Version 2
Per Amundsen, 03/31/2016 11:08 AM
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 | 2 | Per Amundsen | -4 - Connect to Ipv4 addresses. |
10 | -6 - Connect to Ipv6 addresses. |
||
11 | 1 | Per Amundsen | |
12 | *Parameters* |
||
13 | |||
14 | [bindip] - Bind ip to be used. |
||
15 | <name> - Socket connection name. |
||
16 | <address> - Remote ip address to connect to. |
||
17 | <port> - Remote port to connect to. |
||
18 | |||
19 | *Example* |
||
20 | |||
21 | <pre> |
||
22 | alias example { |
||
23 | ;Initiate a connection with "irc.freenode.org" on port 6669, Secured connection. |
||
24 | /sockopen -e IRC irc.freenode.org +6697 |
||
25 | } |
||
26 | |||
27 | on *:sockopen:IRC:{ |
||
28 | ;Send our USER and NICK irc commands. |
||
29 | /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf |
||
30 | /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf |
||
31 | } |
||
32 | |||
33 | ;Show all receiving data in a window. |
||
34 | on *:sockread:IRC:{ |
||
35 | /window -de @IRC |
||
36 | /var %x |
||
37 | /sockread %x |
||
38 | /aline -p @IRC $iif(%x,$v1,-) |
||
39 | } |
||
40 | </pre> |