Posted to tcl by rmax at Mon Jul 03 11:00:23 GMT 2023view raw

  1. --- ijbridge.tcl.orig 2023-07-03 12:57:35.205115845 +0200
  2. +++ ijbridge.tcl 2023-07-03 12:58:37.493083892 +0200
  3. @@ -1112,7 +1112,13 @@
  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. + if {$nick_base == $::client::nick} {
  10. + cmd-send "NICK $nick_base[string range [expr rand()] end-2 end]"
  11. + after 5000 [list cmd-send "NICK $nick_base"]
  12. + } else {
  13. + cmd-send "NICK $nick_base"
  14. + }
  15. }
  16. }
  17.