Posted to tcl by rmax at Mon Jul 03 11:13:21 GMT 2023view raw

  1. --- ijbridge.tcl.orig 2023-07-03 12:57:35.205115845 +0200
  2. +++ ijbridge.tcl 2023-07-03 13:12:32.588677186 +0200
  3. @@ -1112,7 +1112,11 @@
  4. $cn registerevent 433 {
  5. # ERR_NICKNAMEINUSE
  6. if { [lindex [additional] 0] == $::client::nick } {
  7. - cmd-send "NICK [string trimright $::client::nick 0123456789][string range [expr rand()] end-2 end]"
  8. + set nick_base [string trimright $::client::nick 0123456789]
  9. + cmd-send "NICK $nick_base[string range [expr rand()] end-2 end]"
  10. + if {$nick_base != $::client::nick} {
  11. + after 20000 [list cmd-send "NICK $nick_base"]
  12. + }
  13. }
  14. }
  15.  

Comments

Posted by rmax at Mon Jul 03 11:25:45 GMT 2023 [text] [code]

$cn registerevent 433 { # ERR_NICKNAMEINUSE set nick_base [string trimright $::client::nick 0123456789] if { [lindex [additional] 0] == $::client::nick } { cmd-send "NICK $nick_base[string range [expr rand()] end-2 end]" } if {$nick_base != $::client::nick} { after 20000 [list cmd-send "NICK $nick_base"] } }