egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

add owner/master via pub command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
pavel_kbc
Voice


Joined: 28 Dec 2006
Posts: 23

PostPosted: Wed Jan 03, 2007 2:11 pm    Post subject: add owner/master via pub command Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 03, 2007 5:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pavel_kbc
Voice


Joined: 28 Dec 2006
Posts: 23

PostPosted: Wed Jan 03, 2007 7:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber