| View previous topic :: View next topic |
| Author |
Message |
pavel_kbc Voice
Joined: 28 Dec 2006 Posts: 23
|
Posted: Wed Jan 03, 2007 2:11 pm Post subject: add owner/master via pub command |
|
|
hello.
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: |
"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
}
|
_________________ join my irc channel |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Jan 03, 2007 5:18 pm Post subject: |
|
|
This is part of my script FzCommands.tcl. Get it here. The script already does that. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
pavel_kbc Voice
Joined: 28 Dec 2006 Posts: 23
|
Posted: Wed Jan 03, 2007 7:13 pm Post subject: |
|
|
i copied the that from your scripts. i dont need the whole scripts. i just want the add owner/master. can you please modify it for me?? _________________ join my irc channel |
|
| Back to top |
|
 |
|