Advertisement
swarley

Untitled

Jun 8th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. > a) make a particular channel or network/channel tab current;
  2.  
  3. For this, you can use:
  4. set_context(nil, SERVER_NAME) #where SERVER_NAME is the name of the server tab, for example, FreeNode. Use find_context to get a specific context to use for this
  5. command('JOIN #channel_to_join')
  6.  
  7. That will make the server tab you want the main focus, and then calling JOIN to a channel tab you already have open, will make the tab the main focus for the GUI.
  8.  
  9. > b) send text (think self.puts for now) to a particular tab;
  10.  
  11. To do this (assuming you mean to send text to the channel) you have two options:
  12.  
  13. 1)
  14. command('SAY ${ text }')
  15.  
  16. The limitation with this method, is that there is a limit to the length of text that you can send. The way to get past that, is to use number 2.
  17.  
  18. 2)
  19. command('MSG ' + get_info('channel') + ' ' + text)
  20.  
  21. This is still limited to the IRCd's text receive limit, but you are no longer restricted by the SAY's limitations.
  22.  
  23. And to make these work correctly, you must use set_context as described in my first answer.
  24.  
  25. > c) send text specifically to the/a server tab for a specific
  26. > network.
  27.  
  28. To do this, just set_context(nil, server_name) like in the first example, and then use:
  29. command("COMMAND_NAME ARGS")
  30.  
  31. For example,
  32. set_context(nil, 'freenode')
  33. command("MSG #channel Hello!")
  34. would send the message, 'Hello!' to the channel #channel, on the freenode server tab open in the client.
  35.  
  36. Once again, I hope I have helped you :) and I don't regret it at all, I'm always happy to help. As usual, contact me with any further questions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement