[5180] | 1 | A VERY ABBREVIATED INTRO TO IRK |
---|
| 2 | =============================== |
---|
| 3 | |
---|
| 4 | All IRK commands are found within the ::irk namespace. |
---|
| 5 | |
---|
| 6 | To open a connection with an IRC server, use: |
---|
| 7 | |
---|
| 8 | set conn [irk::connect twisted panda1] |
---|
| 9 | |
---|
| 10 | This opens a connection to the server named 'twisted' (This is |
---|
| 11 | actually the server twisted.ma.us.dal.net) with the nickname |
---|
| 12 | 'panda1'. It also saves the connection token in the variable 'conn' |
---|
| 13 | for later use. |
---|
| 14 | |
---|
| 15 | If you're behind a SOCKS5 firewall, you can configure IRK to use a |
---|
| 16 | SOCKS5 proxy: |
---|
| 17 | |
---|
| 18 | irk::config -sockproxy <proxyhost> -sockport <port> |
---|
| 19 | |
---|
| 20 | Do this before attempting to open connections to servers outside the |
---|
| 21 | firewall. After this step all communication with remote IRC servers |
---|
| 22 | goes through the SOCKS5 proxy. At present it is not possible to have |
---|
| 23 | connections simultaneously to IRC servers inside and outside the firewall. |
---|
| 24 | |
---|
| 25 | You can open any number of connections to different servers at the |
---|
| 26 | same time, limited only by the resources available on the host |
---|
| 27 | machine. Most IRC servers disallow opening two or more connections |
---|
| 28 | from the same user to a single server. |
---|
| 29 | |
---|
| 30 | Next, to join a channel, type: |
---|
| 31 | |
---|
| 32 | irk::join $conn #mycoolchannel |
---|
| 33 | |
---|
| 34 | You can join any number of channels (no limits except those imposed by |
---|
| 35 | the server). |
---|
| 36 | |
---|
| 37 | To talk to a channel, do: |
---|
| 38 | |
---|
| 39 | irk::say $conn #mycoolchannel {Wow, I'm on IRC!} |
---|
| 40 | |
---|
| 41 | The message "Wow, I'm on IRC!" (without the quotes) is sent to the |
---|
| 42 | channel #mycoolchannel. |
---|
| 43 | |
---|
| 44 | You can also send a private message to a specific nickname, via: |
---|
| 45 | |
---|
| 46 | irk::say $conn somenick {Hey, I'm talking to you} |
---|
| 47 | |
---|
| 48 | To leave a channel use irk::leave. To close a connection with a server |
---|
| 49 | use irk::close. Read lib/irkcommand.tcl for all the commands |
---|
| 50 | provided. Full documentation will be provided eventually. |
---|
| 51 | |
---|
| 52 | The above API is likely to be subsumed by a more OO API that will look |
---|
| 53 | something like this: |
---|
| 54 | |
---|
| 55 | set conn [irk::connect twisted panda1] |
---|
| 56 | set mychan [$conn join #mycoolchannel] |
---|
| 57 | $mychan say {Wow, I'm on IRC!} |
---|
| 58 | set somenick [$conn user somenick] |
---|
| 59 | $somenick say {Hey, I'm taling to you} |
---|