Code: Select all
##
# Flags for script usage
set foo(flag) "ofmn"
##
# Voice triggers
set foo(vtrig) "voice v"
##
# Devoice triggers
set foo(dvtrig) "devoice dv"
##
# Op triggers
set foo(otrig) "op o"
##
# Deop triggers
set foo(dotrig) "deop do"
##
# Kick triggers
set foo(kick) "kick k"
##
# Ban triggers {"ban" "b"}
set foo(ban) "ban b"
##
# Kickban triggers
set foo(kickb) "kickban kb"
#####
#Stop
#############
bind PUB $foo(flag) [split $foo(vtrig)] voice:proc
bind PUB $foo(flag) [split $foo(dvtrig)] devoice:proc
bind PUB $foo(flag) [split $foo(otrig)] op:proc
bind PUB $foo(flag) [split $foo(dotrig)] deop:proc
bind PUB $foo(flag) [split $foo(kick)] kick:proc
bind PUB $foo(flag) [split $foo(kickb)] kb:proc
bind PUB $foo(flag) [split $foo(ban)] ban:proc
proc voice:proc {nick host hand chan text} {
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
   putquick "MODE $chan +v [lindex [split $text] 0]"
 } else {
   foreach vnick [split $text] {
   pushmode $chan +v $vnick
  } 
 }
}
proc devoice:proc {nick host hand chan text} {
 if {![botisop $chan]} {return}
 if {![isbotnick $nick]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "MODE $chan -v [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  pushmode $chan -v $vnick
  }
 }
}
proc op:proc {nick host hand chan text} {
 if {![botisop $chan]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "MODE $chan +o [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  pushmode $chan +o $vnick
  }
 }
}
proc deop:proc {nick host hand chan text} {
 if {[isbotnick $nick]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "MODE $chan -o [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  pushmode $chan -o $vnick
  }
 }
}
proc kick:proc {nick host hand chan text} {
 if {[isbotnick $nick]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "KICK $chan [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  putkick $chan $vnick
  }
 }
}
proc kb:proc {nick host hand chan text} {
 if {[isbotnick $nick]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "MODE $chan +b [lindex [split $text] 0]"
  putquick "KICK $chan [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  set bhost "[maskhost $vnick![getchanhost $vnick $chan] 2]"
  pushmode $chan +b $bhost
  putkick $chan $vnick
  }
 }
}
proc ban:proc {nick host hand chan text} {
 if {[isbotnick $nick]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  set vnick [lindex [split $text] 0]
  set bhost "[maskhost $vnick![getchanhost $vnick $chan] 2]"
  putquick "MODE $chan +b $bhost"
 } else {
  foreach vnick [split $text] {
  set bhost [maskhost $vnick![getchanhost $vnick $chan] 2]
  pushmode $chan +b $bhost
  }
 }
}
Code: Select all
bind PUB $foo(flag) [split $foo(vtrig)] voice:procCode: Select all
proc op:proc {nick host hand chan text} {
 if {![botisop $chan]} {return}
 if {![botisop $chan]} {return}
 if {[lindex [split $text] 0] == ""} {
  putquick "MODE $chan +o [lindex [split $text] 0]"
 } else {
  foreach vnick [split $text] {
  pushmode $chan +o $vnick
  }
 }
} 
Code: Select all
bind PUB ofmn|ofmn "!autovoice" auto:voice
proc auto:voice {nick host hand chan text} {
#Sets $nick2 which will be !autovoice thisnickhere
  set nick2 [lindex [split $text] 0]   
#Checks if nick2 is on the channel and if not, will stop the script and return with a error message
if {![onchan $nick2 $chan]} { 
      puthelp "PRIVMSG $chan :I don't see $nick2 on $chan"
      return
    } 
#Grabs the handle of the nick
set hand2 [nick2hand $nick2]  
#sets userflag +g on specified nick on the channel
chattr $hand2 +g $chan  
#Message 
puthelp "PRIVMSG $chan :{$nick2}(with handle $hand2) now has Autovoice on $chan"   
}