Code: Select all
tag when posting logs, code
Code: Select all
# Script : VoiceAllBut v1.02 by David Proper (Dr. Nibble [DrN])
# Copyright 2002 Radical Computer Systems
# All Rights Reserved
#
# Testing
# Platforms : Linux 2.2.16 TCL v8.3 (Patch level 8.3.1)
# Eggdrop v1.6.2
# Eggdrop v1.6.6
# And : SunOS 5.8 TCL v8.3
# Eggdrop v1.5.4
#
# Description : VoiceAllBut is an auto-voice script with an exceptions
# list. You can add/remove people from the no-voice list
# via a channel command. VAB will voice all users who
# join except users on the no-voice list.
# Good for botchannels who are +m and want the talker
# bots to just shut up. :)
#
# Requested : UTAKER@DALnet of BotCentral.net and #BotCentral
#
# History : 02/10/2002 - First Release
# 03/25/2002 - v1.01
# o Modified sitemask definition to make a
# more normal mask. (Instead of full domain)
# o Will now de-voice user if they are voiced
# when added to the novoice list and voice
# them when removed. (Suggested by UTAKER)
# 06/21/2002 - v1.02
# o Added subst command to see if that'd help
# with nicks using | and [censored].
# o Added list of channels to voice on.
# (Requested by UTAKER@DALnet)
# o Added public commands to add/del/list VAB
# channel list.
# o Saves channel list to datafile. Will only
# use VAB(chans) list if no datafile is found
#
#
# Future Plans : Fix Bugs. :)
# o Only active on defined channels
#
# Author Contact : Email - DProper@stx.rr.com
# Home Page - http://home.stx.rr.com/dproper
# Homepage Direct Link - http://www.chaotix.net:3000/~dproper
# IRC - Primary Nick: DrN
# UseNet - alt.irc.bots.eggdrop
# Support Channels: #RCS @UnderNet.Org
# #RCS @DALnet
# #RCS @EFnet
# #RCS @GalaxyNet
# #RCS @ChatGalaxy
# #RCS @Choatix Addiction
#
# Current contact information can be located at:
# http://www.chaotix.net:3000/rcs/contact.html
#
# New TCL releases are sent to the following sites as soon as they're released:
#
# FTP Site | Directory
# ---------------------------+-------------------------------
# ftp.chaotix.net | /pub/RCS
# ftp.eggheads.org | Various
# drn.realmweb.org | /drn
#
# Chaotix.Net has returned. Mailing list and web site back.
#
# Radical Computer Systems - http://www.chaotix.net:3000/rcs/
# To subscribe to the RCS mailing list: mail majordomo@chaotix.net and in
# BODY of message, type subscribe rcs-list
#
# Feel free to Email me any suggestions/bug reports/etc.
#
# You are free to use this TCL/script as long as:
# 1) You don't remove or change author credit
# 2) You don't release it in modified form. (Only the original)
#
# If you have a "too cool" modification, send it to me and it'll be
# included in the official release. (With your credit)
#
# Commands Added:
# Where F CMD F CMD F CMD F CMD
# ------- - ---------- - ------------ - ----------- - ----------
# Public: o vab o vablist o vabadd o vabdel
# MSG: N/A
# DCC: N/A
#
# Public Matching: N/A
#
# This is the user-definable flag to use to indicate a user on the no-voice list
set VAB(flag) V
# Default flags to give when adding a new user
set VAB(default-flags) "+h-p"
# User access required to modify/list no-voice list.
set VAB(access) "o|o"
# Define this as the channels you want to protect. * for all
set VAB(chans) "#wales"
# Define this as the file to store dynamic list of channels to voice on
set VAB(datafile) "~/vablist.dat"
# Trigger charactor to use.
set cmdchar_ "*"
set VAB(ver) "v1.02.02"
proc cmdchar { } {global cmdchar_; return $cmdchar_}
bind join - ** VAB_join
proc VAB_join {nick uhost hand chan} {
global VAB
if {![voicechan $chan]} {return 1}
if {([matchchanattr $hand |$VAB(flag) $chan]) || ([matchchanattr $hand o])} {return 0}
pushmode $chan +v $nick
}
bind pub $VAB(access) [cmdchar]vab pub_vab
bind msg $VAB(access) vab pub_vab
proc pub_vab {nick uhost hand chan rest} {
global VAB
subst -nobackslashes -nocommands -novariables rest
if {$rest == ""} {
putserv "NOTICE $nick :Calling Syntax: [cmdchar]vab cmd \[nick\]"
putserv "NOTICE $nick : Commands: list - Lists no-voice users"
putserv "NOTICE $nick : add nick - Add nick to novoice list"
putserv "NOTICE $nick : del nick - Remove nick from novoice list"
return 0
}
set cmd [string toupper [lindex $rest 0]]
set rest [lrange $rest 1 end]
switch $cmd {
"LIST" {vab_listuser $nick $uhost $hand $chan $rest}
"ADD" {vab_adduser $nick $uhost $hand $chan $rest}
"DEL" {vab_deluser $nick $uhost $hand $chan $rest}
}
}
proc vab_adduser {nick uhost hand chan rest} {
global VAB
subst -nobackslashes -nocommands -novariables rest
if {$rest == ""} {putserv "NOTICE $nick :Calling Syntax: [cmdchar]vab add nick"; return 0}
set user [lindex $rest 0]
if {![onchan $user $chan]} {set thand $user} else {set thand [nick2hand $user]}
if {![validuser $thand]} {
if {![onchan $user $chan]} {putserv "NOTICE $nick :$user is not on $chan. Can't get a hostmask to add as new user."; return 0}
if {$thand == "*"} {set thand $user}
set sitemask "*!*[string trimleft [maskhost [getchanhost $user $chan]] *!]"
set rt [adduser $thand $sitemask]
if {$rt == 1} {set rt "Success"} else {set rt "Failed"}
putserv "NOTICE $nick :Adding $user\($thand\): $rt"
set rt [chattr $thand ${VAB(default-flags)}]
putserv "NOTICE $nick :Setting default flags for $user\($thand\): $rt"
}
if {([matchchanattr $thand |$VAB(flag) $chan])} {putserv "NOTICE $nick :$user is allready no-voiced on $chan"; return 0}
set rt [chattr $thand |+$VAB(flag) $chan]
putserv "NOTICE $nick :Flags for $user\($thand\) are now: $rt"
if {[isvoice $user $chan]} {pushmode $chan -v $user}
#putserv "NOTICE $user :You are now being devoiced, you will not be revoiced.
putserv "NOTICE $user :You are now being devoiced, you will not be revoiced on rejoin."
putserv "NOTICE $user :You can only be revoiced once the no-voice ban is lifted on you."
#devoiced no wont be revoived on entyr eiuther
}
proc vab_deluser {nick uhost hand chan rest} {
global VAB
subst -nobackslashes -nocommands -novariables rest
if {$rest == ""} {putserv "NOTICE $nick :Calling Syntax: [cmdchar]vab add nick"; return 0}
set user [lindex $rest 0]
if {![validuser $user]} {putserv "NOTICE $nick :$user is not a valid user."; return 0}
if {(![matchchanattr $user |$VAB(flag) $chan])} {putserv "NOTICE $nick :$user isn't on the no-voiced for $chan"; return 0}
set rt [chattr $user |-$VAB(flag) $chan]
putserv "NOTICE $nick :Flags for $user are now: $rt"
if {[isvoice $user $chan]} {pushmode $chan +v $user}
putserv "NOTICE $user :You are now voiced and being removed from the blacklist."
putquick "MODE $chan +v $user"
}
bind pub o|o [cmdchar]vablist pub_VABlist
bind msg o|o vablist pub_VABlist
proc pub_VABlist {nick uhost hand channel rest} {
global VAB
if {$VAB(chans) == ""} {puthelp "NOTICE $nick :VAB Channel list is empty."
} else {puthelp "NOTICE $nick :Current VAB channels are: $VAB(chans)"
}
}
bind pub o|o [cmdchar]vabadd pub_VABadd
bind msg o|o vabadd pub_VABadd
proc pub_VABadd {nick uhost hand channel rest} {
global VAB
if {[voicechan $channel]} {
puthelp "NOTICE $nick :$channel allready in VAB List"
return 0
}
puthelp "NOTICE $nick :Adding $channel to VAB List"
lappend VAB(chans) $channel
save_VAB
}
bind pub o|o [cmdchar]vabdel pub_VABdel
bind pub o|o vabdel pub_VABdel
proc pub_VABdel {nick uhost hand channel rest} {
global VAB
if {![voicechan $channel]} {
puthelp "NOTICE $nick :$channel not found in VAB List"
return 0
}
puthelp "NOTICE $nick :Removing $channel from VAB List"
set chans $VAB(chans)
set VAB(chans) ""
foreach chan $chans {
if {[string tolower $chan] != [string tolower $channel]} {lappend VAB(chans) $chan}
}
save_VAB
}
proc voicechan {chan} {
global VAB
set chan [string tolower $chan]
set chans [string tolower $VAB(chans)]
if {$chan == "*"} {set chans [string tolower [channels]]}
set dothechan 0
foreach c $chans {
if {($chan == $c)} {set dothechan 1}
}
if {$dothechan == 0} {return 0} else {return 1}
}
proc vab_listuser {nick uhost hand chan rest} {
global VAB
subst -nobackslashes -nocommands -novariables rest
set users [userlist |$VAB(flag) $chan]
putserv "NOTICE $nick :The following are listed as no-voice for $chan: $users"
}
proc load_VAB {} {
global VAB
if {[file exists $VAB(datafile)]} {
set in [open $VAB(datafile) r]
set VAB(chans) [gets $in]
close $in
} {putlog "-VAB- Datafile $VAB(datafile) not found. Using default channel list."}
}
load_VAB
proc save_VAB {} {
global VAB
putlog "Saving VAB Data to $VAB(datafile)"
set out [open $VAB(datafile) w]
puts $out $VAB(chans)
close $out
}
putlog "VoiceAllBut $VAB(ver) by David Proper (DrN) -:LoadeD:-"
return "VoiceAllBut $VAB(ver) by David Proper (DrN) -:LoadeD:-"
Code: Select all
set vabison 1
bind pub o !vabon foo
bind pub o !vaboff foo
proc foo {args} {
if {$::lastbind == "!vabon"} {set ::vabison 1} {set ::vabison 0}
}
Code: Select all
if !$::vabison return
Code: Select all
tag when posting logs, code
Code: Select all
tag when posting logs, code
Code: Select all
tag when posting logs, code
In sources of your bot open file src/eggdrop.h and find there a stringdohboy2 wrote:Anyone know of a fix for users with nicknames that are longer than 9 characters?
[00:35:41] <@dohboy> .vab add infamous_cow
[00:35:43] -VoiceR- Adding infamous_cow(infamous_cow): Success
[00:35:43] -VoiceR- Setting default flags for infamous_cow(infamous_cow): *
[00:35:44] -VoiceR- Flags for infamous_cow(infamous_cow) are now: *
[00:35:55] <@dohboy> .vab add infamous_
[00:35:58] -VoiceR- Flags for infamous_(infamous_) are now: hp|V
In the config file I set the nick length to 26, and I don't think I have access to recompile the bot to change the NICKMAX or HANDLEN settings. Anyone know of a workaround for that?
Code: Select all
#define HANDLEN 9 /* valid values 9->NICKMAX */
Code: Select all
#define HANDLEN 32 /* valid values 9->NICKMAX */