Guest User

Untitled

a guest
Mar 5th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.75 KB | None | 0 0
  1. proc pub_do_addfriend {nick host hand chan arg} {
  2.     foreach {who} [split $arg] {
  3.         if ![onchan $who $chan] {
  4.             putquick "notice $nick :I don't see $who :("           
  5.             continue
  6.         }
  7.  
  8.         if ![validuser $who] {
  9.             set success = [adduser $who [maskhost [getchanhost $who $chan]]]
  10.             set index 1
  11.             while {[catch $success]} {
  12.                 set n [expr {int(rand()*100)}]
  13.                 set success = [adduser "$who$n" [maskhost [getchanhost $who $chan]]]
  14.                 incr $index
  15.                 if {$index == 5} { break }
  16.             }
  17.             if {!$success} {
  18.                 putquick "notice $nick :Failed to add $who."
  19.                 continue
  20.             }
  21.             putquick "notice $nick :Added $who."
  22.         }
  23.  
  24.         if ![matchattr $who +f $chan] {
  25.             chattr $who +f $chan
  26.             putquick "notice $nick :Marked $who as friend on $chan."
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment