Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc pub_do_addfriend {nick host hand chan arg} {
- foreach {who} [split $arg] {
- if ![onchan $who $chan] {
- putquick "notice $nick :I don't see $who :("
- continue
- }
- if ![validuser $who] {
- set success = [adduser $who [maskhost [getchanhost $who $chan]]]
- set index 1
- while {[catch $success]} {
- set n [expr {int(rand()*100)}]
- set success = [adduser "$who$n" [maskhost [getchanhost $who $chan]]]
- incr $index
- if {$index == 5} { break }
- }
- if {!$success} {
- putquick "notice $nick :Failed to add $who."
- continue
- }
- putquick "notice $nick :Added $who."
- }
- if ![matchattr $who +f $chan] {
- chattr $who +f $chan
- putquick "notice $nick :Marked $who as friend on $chan."
- }
- }
- }
Add Comment
Please, Sign In to add comment