This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

add owner/master via pub command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

add owner/master via pub command

Post by pavel_kbc »

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: 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

  }
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This is part of my script FzCommands.tcl. Get it here. The script already does that.
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

Post by pavel_kbc »

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??
Post Reply