Voiceops

From ProjectWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Valera (Talk); changed back to last version by Wikisysop)
Line 1: Line 1:
 +
=[http://akekuqegify.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
__TOC__
 
__TOC__
 
==Whats This?==
 
==Whats This?==
Line 9: Line 10:
  
 
==To Do==
 
==To Do==
<s>Allow setting a channel flag on the bot to enable voiceops for that channel.</s> DONE!! 2008.09.18 :D
+
&lt;s&gt;Allow setting a channel flag on the bot to enable voiceops for that channel.&lt;/s&gt; DONE!! 2008.09.18 :D
  
 
Help could be a bit more verbose explaining which arguments are accepted
 
Help could be a bit more verbose explaining which arguments are accepted
Line 18: Line 19:
 
Or copy/paste this:
 
Or copy/paste this:
  
<source lang="tcl">
+
&lt;source lang=&quot;tcl&quot;&gt;
 
#############
 
#############
 
# Voiceops.tcl - lets +v or +o users !kick !topic !ban !unban !invite
 
# Voiceops.tcl - lets +v or +o users !kick !topic !ban !unban !invite
Line 27: Line 28:
  
 
#bindings go here, change if u wish
 
#bindings go here, change if u wish
bind pub - "!kick" pub:kick
+
bind pub - &quot;!kick&quot; pub:kick
bind pub - "!topic" pub:topic
+
bind pub - &quot;!topic&quot; pub:topic
bind pub - "!ban" pub:ban
+
bind pub - &quot;!ban&quot; pub:ban
bind pub - "!unban" pub:unban
+
bind pub - &quot;!unban&quot; pub:unban
bind pub - "!invite" pub:invite
+
bind pub - &quot;!invite&quot; pub:invite
bind pub - "!+m" pub:moderate
+
bind pub - &quot;!+m&quot; pub:moderate
bind pub - "!-m" pub:unmoderate
+
bind pub - &quot;!-m&quot; pub:unmoderate
bind pub - "!+i" pub:plusi
+
bind pub - &quot;!+i&quot; pub:plusi
bind pub - "!-i" pub:minusi
+
bind pub - &quot;!-i&quot; pub:minusi
bind pub - "!lockdown" pub:lockdown
+
bind pub - &quot;!lockdown&quot; pub:lockdown
bind pub - "!release" pub:release
+
bind pub - &quot;!release&quot; pub:release
bind pub - "!voiceops" pub:voiceopshelp
+
bind pub - &quot;!voiceops&quot; pub:voiceopshelp
 
setudef flag voiceops
 
setudef flag voiceops
  
putlog "voiceop.tcl loaded! :P"
+
putlog &quot;voiceop.tcl loaded! :P&quot;
  
 
#function to make sure the user is voiced or opped, and this channel supports voiceop
 
#function to make sure the user is voiced or opped, and this channel supports voiceop
 
proc voiceop:validuser {nick chan} {
 
proc voiceop:validuser {nick chan} {
   if {([isop $nick $chan] || [isvoice $nick $chan]) && ([channel get $chan voiceops])} {
+
   if {([isop $nick $chan] || [isvoice $nick $chan]) &amp;&amp; ([channel get $chan voiceops])} {
 
     return 1
 
     return 1
 
   } else {
 
   } else {
Line 55: Line 56:
 
proc pub:voiceopshelp {nick host hand chan text} {
 
proc pub:voiceopshelp {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     puthelp "PRIVMSG $chan :Valid commands are: !kick !topic !ban !unban !invite !+m !-m !+i !-i !lockdown (moderate+invite) !release (terminate lockdown mode)"
+
     puthelp &quot;PRIVMSG $chan :Valid commands are: !kick !topic !ban !unban !invite !+m !-m !+i !-i !lockdown (moderate+invite) !release (terminate lockdown mode)&quot;
 
   }   
 
   }   
 
}
 
}
Line 64: Line 65:
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
 
     if {[onchan $whom $chan]} {  
 
     if {[onchan $whom $chan]} {  
       puthelp "PRIVMSG $chan :$nick, are u blind?! $whom is already in $chan! :P"
+
       puthelp &quot;PRIVMSG $chan :$nick, are u blind?! $whom is already in $chan! :P&quot;
 
     } else {
 
     } else {
       puthelp "PRIVMSG $chan :inviting $whom to $chan..."
+
       puthelp &quot;PRIVMSG $chan :inviting $whom to $chan...&quot;
       puthelp "INVITE $whom $chan"
+
       puthelp &quot;INVITE $whom $chan&quot;
       putlog "$nick invited $whom to $chan"
+
       putlog &quot;$nick invited $whom to $chan&quot;
 
     }
 
     }
 
   }
 
   }
Line 76: Line 77:
 
proc pub:lockdown {nick host hand chan text} {
 
proc pub:lockdown {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick locked down $chan"
+
     putlog &quot;$nick locked down $chan&quot;
     puthelp "MODE $chan +m+i"
+
     puthelp &quot;MODE $chan +m+i&quot;
     puthelp "PRIVMSG $chan :channel in lockdown mode use !release to clear"
+
     puthelp &quot;PRIVMSG $chan :channel in lockdown mode use !release to clear&quot;
 
   }
 
   }
 
}
 
}
Line 85: Line 86:
 
proc pub:release {nick host hand chan text} {
 
proc pub:release {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick unlocked down $chan"
+
     putlog &quot;$nick unlocked down $chan&quot;
     puthelp "MODE $chan -m-i"
+
     puthelp &quot;MODE $chan -m-i&quot;
 
   }
 
   }
 
}
 
}
Line 93: Line 94:
 
proc pub:plusi {nick host hand chan text} {
 
proc pub:plusi {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick made $chan invite only"
+
     putlog &quot;$nick made $chan invite only&quot;
     puthelp "MODE $chan +i"
+
     puthelp &quot;MODE $chan +i&quot;
 
   }
 
   }
 
}
 
}
Line 101: Line 102:
 
proc pub:minusi {nick host hand chan text} {
 
proc pub:minusi {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick set $chan -i"
+
     putlog &quot;$nick set $chan -i&quot;
     puthelp "MODE $chan -i"
+
     puthelp &quot;MODE $chan -i&quot;
 
   }
 
   }
 
}
 
}
Line 109: Line 110:
 
proc pub:moderate {nick host hand chan text} {
 
proc pub:moderate {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick moderated $chan"
+
     putlog &quot;$nick moderated $chan&quot;
     puthelp "MODE $chan +m"
+
     puthelp &quot;MODE $chan +m&quot;
 
   }
 
   }
 
}
 
}
Line 117: Line 118:
 
proc pub:unmoderate {nick host hand chan text} {
 
proc pub:unmoderate {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick unmoderated $chan"
+
     putlog &quot;$nick unmoderated $chan&quot;
     puthelp "MODE $chan -m"
+
     puthelp &quot;MODE $chan -m&quot;
 
   }
 
   }
 
}
 
}
Line 126: Line 127:
 
   set hostmask [lindex $text 0]
 
   set hostmask [lindex $text 0]
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putlog "$nick removed ban $hostmask from $chan"
+
     putlog &quot;$nick removed ban $hostmask from $chan&quot;
     puthelp "MODE $chan -b $hostmask"
+
     puthelp &quot;MODE $chan -b $hostmask&quot;
 
   }
 
   }
 
}
 
}
Line 138: Line 139:
 
     if {[onchan $whom $chan]} {
 
     if {[onchan $whom $chan]} {
 
       if {![isop $whom $chan]} {
 
       if {![isop $whom $chan]} {
         putserv "MODE $chan +b *!$bhost"
+
         putserv &quot;MODE $chan +b *!$bhost&quot;
 
         pub:kick $nick $host $hand $chan $text
 
         pub:kick $nick $host $hand $chan $text
         putlog "$nick banned $whom on $chan"
+
         putlog &quot;$nick banned $whom on $chan&quot;
 
       } else {
 
       } else {
         puthelp "PRIVMSG $chan :nowai i'm banin' an op!!!"
+
         puthelp &quot;PRIVMSG $chan :nowai i'm banin' an op!!!&quot;
 
       }
 
       }
 
     } else {
 
     } else {
       puthelp "PRIVMSG $chan :$nick $whom is not on $chan"
+
       puthelp &quot;PRIVMSG $chan :$nick $whom is not on $chan&quot;
 
     }
 
     }
 
   }
 
   }
Line 153: Line 154:
 
proc pub:topic {nick host hand chan text} {
 
proc pub:topic {nick host hand chan text} {
 
   if {[voiceop:validuser $nick $chan]} {
 
   if {[voiceop:validuser $nick $chan]} {
     putserv "TOPIC $chan :$text"
+
     putserv &quot;TOPIC $chan :$text&quot;
     putlog "$nick changed topic to $text on $chan"
+
     putlog &quot;$nick changed topic to $text on $chan&quot;
 
   }
 
   }
 
}
 
}
Line 165: Line 166:
 
     if {[onchan $whom $chan]} {
 
     if {[onchan $whom $chan]} {
 
       if {![isop $whom $chan]} {
 
       if {![isop $whom $chan]} {
         putserv "KICK $chan $whom :$reason"
+
         putserv &quot;KICK $chan $whom :$reason&quot;
         putlog "$nick kicked $whom from $chan"
+
         putlog &quot;$nick kicked $whom from $chan&quot;
 
       } else {
 
       } else {
         puthelp "PRIVMSG $chan :nowai i'm kickin' an op!!!"
+
         puthelp &quot;PRIVMSG $chan :nowai i'm kickin' an op!!!&quot;
 
       }
 
       }
 
     } else {
 
     } else {
       puthelp "PRIVMSG $chan :$nick $whom is not on $chan"
+
       puthelp &quot;PRIVMSG $chan :$nick $whom is not on $chan&quot;
 
     }
 
     }
 
   }
 
   }
 
}
 
}
</source>
+
&lt;/source&gt;

Revision as of 00:26, 24 November 2010

UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY

Contents

Whats This?

Eggdrop tcl script that enables otherwise powerless users with +v in a channel to kick, ban or set topics sorta providing halfops type functionality on networks limited to ops and voices (like efnet :). Will not of course ban/kick ops! ^^

After copying to your scripts directory and adding to the bot's config file type:

.chanset #somechannel +voiceops

to activate for that channel

To Do

<s>Allow setting a channel flag on the bot to enable voiceops for that channel.</s> DONE!! 2008.09.18 :D

Help could be a bit more verbose explaining which arguments are accepted

Source Code

Either download this: voiceops.tcl.txt Or copy/paste this:

<source lang="tcl">

  1. Voiceops.tcl - lets +v or +o users !kick !topic !ban !unban !invite
  2. .chanset #somechannel +voiceops to activate
  3. voice'd users may type !voiceops for help
  4. enjoys \^_^/!!!!


  1. bindings go here, change if u wish

bind pub - "!kick" pub:kick bind pub - "!topic" pub:topic bind pub - "!ban" pub:ban bind pub - "!unban" pub:unban bind pub - "!invite" pub:invite bind pub - "!+m" pub:moderate bind pub - "!-m" pub:unmoderate bind pub - "!+i" pub:plusi bind pub - "!-i" pub:minusi bind pub - "!lockdown" pub:lockdown bind pub - "!release" pub:release bind pub - "!voiceops" pub:voiceopshelp setudef flag voiceops

putlog "voiceop.tcl loaded! :P"

  1. function to make sure the user is voiced or opped, and this channel supports voiceop

proc voiceop:validuser {nick chan} {

 if {([isop $nick $chan] || [isvoice $nick $chan]) && ([channel get $chan voiceops])} {
   return 1
 } else {
   return 0
 }

}

  1. Help me erin!!!

proc pub:voiceopshelp {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   puthelp "PRIVMSG $chan :Valid commands are: !kick !topic !ban !unban !invite !+m !-m !+i !-i !lockdown (moderate+invite) !release (terminate lockdown mode)"
 }  

}

  1. invite a user to channel

proc pub:invite {nick host hand chan text} {

 set whom [lindex $text 0]
 if {[voiceop:validuser $nick $chan]} {
   if {[onchan $whom $chan]} { 
     puthelp "PRIVMSG $chan :$nick, are u blind?! $whom is already in $chan! :P"
   } else {
     puthelp "PRIVMSG $chan :inviting $whom to $chan..."
     puthelp "INVITE $whom $chan"
     putlog "$nick invited $whom to $chan"
   }
 }

}

  1. lockdown channel (set chanmode +im)

proc pub:lockdown {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick locked down $chan"
   puthelp "MODE $chan +m+i"
   puthelp "PRIVMSG $chan :channel in lockdown mode use !release to clear"
 }

}

  1. release lockdown'd channel (set chanmode -im)

proc pub:release {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick unlocked down $chan"
   puthelp "MODE $chan -m-i"
 }

}

  1. make channel invite only

proc pub:plusi {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick made $chan invite only"
   puthelp "MODE $chan +i"
 }

}

  1. moderate channel

proc pub:minusi {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick set $chan -i"
   puthelp "MODE $chan -i"
 }

}

  1. moderate channel

proc pub:moderate {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick moderated $chan"
   puthelp "MODE $chan +m"
 }

}

  1. unmoderate channel

proc pub:unmoderate {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick unmoderated $chan"
   puthelp "MODE $chan -m"
 }

}

  1. remove a ban from a channel

proc pub:unban {nick host hand chan text} {

 set hostmask [lindex $text 0]
 if {[voiceop:validuser $nick $chan]} {
   putlog "$nick removed ban $hostmask from $chan"
   puthelp "MODE $chan -b $hostmask"
 }

}

  1. ban a user from channel

proc pub:ban {nick host hand chan text} {

 set whom [lindex $text 0]
 if {[voiceop:validuser $nick $chan]} {
   set bhost [getchanhost $whom $chan]
   if {[onchan $whom $chan]} {
     if {![isop $whom $chan]} {
       putserv "MODE $chan +b *!$bhost"
       pub:kick $nick $host $hand $chan $text
       putlog "$nick banned $whom on $chan"
     } else {
       puthelp "PRIVMSG $chan :nowai i'm banin' an op!!!"
     }
   } else {
     puthelp "PRIVMSG $chan :$nick $whom is not on $chan"
   }
 }

}

  1. change channel topic

proc pub:topic {nick host hand chan text} {

 if {[voiceop:validuser $nick $chan]} {
   putserv "TOPIC $chan :$text"
   putlog "$nick changed topic to $text on $chan"
 }

}

  1. kick user from channel

proc pub:kick {nick host hand chan text} {

 set whom [lindex $text 0]
 set reason [lrange $text 1 end]
 if {[voiceop:validuser $nick $chan]} {
   if {[onchan $whom $chan]} {
     if {![isop $whom $chan]} {
       putserv "KICK $chan $whom :$reason"
       putlog "$nick kicked $whom from $chan"
     } else {
       puthelp "PRIVMSG $chan :nowai i'm kickin' an op!!!"
     }
   } else {
     puthelp "PRIVMSG $chan :$nick $whom is not on $chan"
   }
 }

} </source>

Personal tools
irssi scripts
eggdrop scripts