mruno

Freenode IRC SASL mIRC Script

Oct 15th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.52 KB | None | 0 0
  1. ;Originally found here http://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=5&Number=228222
  2. ;edited by mruno
  3. ;----------------------------------------------------------------------------------------------------------------------
  4. ;Instructions:
  5. ;1) Copy and paste all of the code here into a new blank file. /write -c freenode.sasl.mrc
  6. ;2) Load the file you created and reorder it to load as the first remote script. /load -rs1 freenode.sasl.mrc
  7. ;3) If you haven't already register your nickname on Freenode using /msg Nickserv Register <password> <email>
  8. ;NOTE: A confirmation email will be sent. Follow the commands in the email to complete your nick registeration
  9. ;NOTE: if you cannot connect with mirc due to SASL errors, use the webclient at https://webchat.freenode.net/ and follow go back to step 3
  10. ;4) Change the your_username and your_password aliases to your username and password that were registered with Freenode's Nickserv
  11. ;5) Connect to irc.freenode.net - /server irc.freenode.net
  12. ;----------------------------------------------------------------------------------------------------------------------
  13.  
  14. alias -l your_username return CHANGE THIS
  15. alias -l your_password return CHANGE THIS
  16.  
  17. on ^*:LOGON:*:{
  18.   if ($network == Freenode) || (!$network) {
  19.     var %user $your_username
  20.     var %password $your_password
  21.     .raw CAP LS
  22.     echo -s Checking capabilities...
  23.     .raw USER %user 0 * : $+ $fullname
  24.     .raw NICK $mnick
  25.     enable #sasl
  26.     halt
  27.   }
  28. }
  29.  
  30. #sasl off
  31.  
  32. raw 001:*:disable #sasl
  33. raw CAP:* LS *:{
  34.   echo -s Capabilities: $3-
  35.   var %tok
  36.   if ($findtok($3-,sasl,32) != $null) set %tok $addtok(%tok,sasl,32)
  37.   if ($findtok($3-,multi-prefix,32) != $null) set %tok $addtok(%tok,multi-prefix,32)
  38.   if ($findtok($3-,packet-size,32) != $null) set %tok %addtok(%tok,packet-size=1024,32)
  39.   if (%tok != $null) {
  40.     echo -s Enabling: %tok
  41.     .raw CAP REQ : $+ %tok
  42.   }
  43.   if ($findtok($3-,sasl,32) == $null) .raw CAP END
  44.   halt
  45. }
  46.  
  47. raw CAP:* ACK sasl*:.raw AUTHENTICATE PLAIN
  48. raw AUTHENTICATE:+:{
  49.   if ($network == Freenode) || (!$network)  {
  50.     var %user $your_username
  51.     var %password $your_password
  52.     sasl-plain %user %password
  53.     halt
  54.   }
  55. }
  56. raw 903:*:.raw CAP END
  57. raw 904:*:.raw CAP END
  58. raw 905:*:.raw CAP END
  59. raw 906:*:.raw CAP END
  60. raw 907:*:.raw CAP END
  61.  
  62. #sasl end
  63.  
  64. alias sasl-plain {
  65.   bset -t &auth 1 $1
  66.   bset -t &auth $calc( $bvar(&auth,0) + 2 ) $1
  67.   bset -t &auth $calc( $bvar(&auth,0) + 2 ) $2
  68.   var %len = $encode(&auth,mb)
  69.   .raw AUTHENTICATE $bvar(&auth,1,%len).text
  70. }
Add Comment
Please, Sign In to add comment