i want a scripts. that can add owner/master/friend via public command
!master <chan> <add/del> <nick>. (owners only)
!owner <chan> <add/del> <nick>. (global owners only)
please modify it for me
Code: Select all
"master" {
if {![check:auth $nick $hand]} {return 0}
if {![matchattr $hand n|n $chan]} {return 0}
if {[lindex [split $arg] 1] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)master <add/del> <nick>."
return 0
}
if {[string equal -nocase "add" "[lindex [split $arg] 1]"]} {
if {[lindex [split $arg] 2] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)master <add/del> <nick>."
return 0
}
if {[isbotnick [lindex [split $arg] 2]]} {
puthelp "NOTICE $nick :$fzcom(logo): You can't add/del me from masters."
return 0
}
if {[onchan [set anick [lindex [split $arg] 2]] $chan]} {
if {![validuser [nick2hand $anick]]} {
if {![validuser $anick]} {
adduser $anick [maskhost [getchanhost $anick $chan]]
}
chattr $anick |+mo $chan
puthelp "NOTICE $nick :$fzcom(logo): added $anick ([maskhost [getchanhost $anick $chan]]) as master on $chan."
puthelp "NOTICE $anick :$fzcom(logo): You've been added as master on $chan, '/msg $botnick pass <password>' to set your pass."
} else {
if {[matchattr [nick2hand $anick] |mo $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): $anick already is a master on $chan."
} else {
chattr [nick2hand $anick] |+mo $chan
puthelp "NOTICE $nick :$fzcom(logo): Gave +mo to $anick ([nick2hand $anick]) on $chan."
if {[passwdok [nick2hand $anick] ""]} {
puthelp "NOTICE $anick :$fzcom(logo): you've been added as master on $chan, '/msg $botnick pass <password>' to set your pass."
} else {
puthelp "NOTICE $anick :$fzcom(logo): You've ([nick2hand $anick]) been added as master on $chan, use your current set pass or msg admin to change it."
}
}
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not on $chan."
}
} elseif {[string equal -nocase "del" "[lindex [split $arg] 1]"]} {
if {[lindex [split $arg] 2] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)master <add/del> <nick>."
return 0
}
if {[isbotnick [lindex [split $arg] 2]]} {
puthelp "NOTICE $nick :$fzcom(logo): You can't add/del me from master."
return 0
}
if {[onchan [set anick [lindex [split $arg] 2]] $chan]} {
if {![validuser [nick2hand $anick]] || ![matchattr [nick2hand $anick] |mo $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not a master on $chan."
} else {
chattr [nick2hand $anick] |-mo $chan
puthelp "NOTICE $nick :$fzcom(logo): $anick ([nick2hand $anick]) has been removed from master on $chan."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not on $chan."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)master <add/del> <nick>."
}
return 0
}
"owner" {
if {![check:auth $nick $hand]} {return 0}
if {![matchattr $hand n]} {return 0}
if {[lindex [split $arg] 1] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)owner <add/del> <nick>."
return 0
}
if {[string equal -nocase "add" "[lindex [split $arg] 1]"]} {
if {[lindex [split $arg] 2] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)owner <add/del> <nick>."
return 0
}
if {[isbotnick [lindex [split $arg] 2]]} {
puthelp "NOTICE $nick :$fzcom(logo): You can't add/del me from owners."
return 0
}
if {[onchan [set anick [lindex [split $arg] 2]] $chan]} {
if {![validuser [nick2hand $anick]]} {
if {![validuser $anick]} {
adduser $anick [maskhost [getchanhost $anick $chan]]
}
chattr $anick |+n $chan
puthelp "NOTICE $nick :$fzcom(logo): added $anick ([maskhost [getchanhost $anick $chan]]) as owner on $chan."
puthelp "NOTICE $anick :$fzcom(logo): You've been added as owner on $chan, '/msg $botnick pass <password>' to set your pass."
} else {
if {[matchattr [nick2hand $anick] |n $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): $anick already is an owner on $chan."
} else {
chattr [nick2hand $anick] |+n $chan
puthelp "NOTICE $nick :$fzcom(logo): Gave +n to $anick ([nick2hand $anick]) on $chan."
if {[passwdok [nick2hand $anick] ""]} {
puthelp "NOTICE $anick :$fzcom(logo): you've been added as owner on $chan, '/msg $botnick pass <password>' to set your pass."
} else {
puthelp "NOTICE $anick :$fzcom(logo): You've ([nick2hand $anick]) been added as owner on $chan, use your current password or msg bot owner to change it."
}
}
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not on $chan."
}
} elseif {[string equal -nocase "del" "[lindex [split $arg] 1]"]} {
if {[lindex [split $arg] 2] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)owner <add/del> <nick>."
return 0
}
if {[isbotnick [lindex [split $arg ]2]]} {
puthelp "NOTICE $nick :$fzcom(logo): You can't add/del me from owners."
return 0
}
if {[onchan [set anick [lindex [split $arg] 2]] $chan]} {
if {![validuser [nick2hand $anick]] || ![matchattr [nick2hand $anick] |n $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not an owner on $chan."
} else {
chattr [nick2hand $anick] |-n $chan
puthelp "NOTICE $nick :$fzcom(logo): $anick ([nick2hand $anick]) has been removed from owner on $chan."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $anick is not on $chan."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)owner <add/del> <nick>."
}
return 0
}