# Bazman`s SuPeRsCrIpT v1.0
# Written by Bazman : bazman@loveconnections4all.com
# Date: 12/24/2006

# I tested it on Eggdrop 1.6.18, and I didn't find any bugs :)
# If you find one, pls email it to me: bazman@loveconnections4all.com

# Version history:
# 1.0beta - my first attempt at this script, it may have some bugs (I hope not).
# 1.0 I have fixed the unban and added: !deshit, !reload, !rehash, !restart, !die bugs fixed bugs at userlevs and added: !users, !bans, !slap, !massop, !massvoice, (chanmode +/-voiceall)

# Msg Commands are: slap, hop

# Public Commands are set to: !date, !version, !time, !server, !status, !ping, !hop
# !mode, !addm, !addop, !adduser, !msg, !say, !topic, !kick, !del, !away
# *!fuck*, !kb, !unban, !shit, !deshit, !fishbot, !back, !ccs, !join, !part
# !op, !deop, !fop, !voice, !devoice, *!halfop*, *!dehalfop*, !reload, !rehash
# !restart, !die, !away, !back, !users, !bans, !slap, !mop, !mvoice

# * = optional

# NOTE: THIS SCRIPT WILL MAKE YOUR BOT KINDA RUDE.
# I do not take responsability for any damage this script may cause to teh sever or
# computer it is on or the network or bot...
# I also am warning everyone that uses this script that it can be offenceive to sum!

# ------------Thanks, Bazman ;) ------------

############################################################################################
################################ C O N F I G U R A T I O N #################################
############################################################################################

# I added a new channel flag "voiceall", if it's set to 1, the bot will voice everyone who
# joins the channel. If it's set to 0 the bot will not voice all users who join the channel.
# You can change this flag, as the others. (via DCC CHAT: .chanset #chan +/-voiceall)

# If your bot is on QuakeNet network, you can invite fishbot (a fun bot) to your channel
# with one command.
#Requested by Gr|ep ;)
# If you want to use this command, set this to 1.
# If you don't want it, set to 0.
 set fishbot 0

# If your IRC server uses chanmode +h (halfop), set this to 1.
# If it doesn't, set to 0.
 set usehalfop 1

# "Fuck" is a bad word (If you don't like seals lol) 
# I added a command to this tcl, it's just for fun (Try It).
# If you want to enable !fuck, set this to 1.
# If you don't like bad words, set it to 0.
 set dofuck 1

# Just a little deop protection... 
# This is a 2 part protection...
# Set this to 1 if you want the bot to /hop upon getting deopped,
# or set it to 0 if it should ignore it.
 set hopondeop 1

# Now that the bot is pissed...
# Set this to 1 to kick those who deoped it, 0 if your to scared of retaleation.
# NOTE: The bot owner will be immune to this kick even if it is enabled.
 set kickondeop 0

############################################################################################
################################# S U P E R - S C R I P T ##################################
############################################################################################
############ d o n ' t   e v e n  t h i n k  a b o u t  e d i t i n g  b e l o w ###########
################# U n l e s s  y o u r  a  g o d  l i k e  m e ! ! ! #######################
######################################### ;) ###############################################
############################################################################################

putlog "Bazman`s SuPeRsCrIpT v1.0 AcTiVaTeD. To the power of greyscull your a DUMBASS!!!"

bind pub o|o !date pub_do_date
bind pub o|o !version pub_say_ver
bind pub o|o !time pub_do_time
bind pub o|o !server pub_do_srv
bind pub m|m !ccs pub_do_ccs
bind pub o|o !modo pub_do_mode
bind pub -|- !help pub_do_help
bind pub o|o !voz pub_do_voice
bind pub o|o !devoz pub_do_devoice
bind pub o|o !% pub_do_halfop
bind pub o|o !de% pub_do_dehalfop
bind pub n !addm pub_do_addm
bind pub m !adduser pub_add_user
bind pub o|o !msg pub_do_msg
bind pub o|o !topic pub_do_topic
bind pub m|m !addop pub_do_addop
bind pub o|o !o pub_do_op
bind pub o|o !fop pub_do_fakeop
bind pub n|n !say pub_do_say
bind pub n !chattr pub_do_chattr
bind pub o|o !patadon pub_do_ban
bind pub -|- !ping pub_do_ping
bind pub n !del pub_do_del
bind pub o|o !do pub_do_deop
bind pub o|o !pata pub_do_kick
bind pub m|m !shit pub_do_pban
bind pub n !away pub_do_away
bind pub n !back pub_do_back
bind pub -|- !fuck pub_do_fuck
bind pub o|o !unban pub_do_unban
bind pub m|m !deshit pub_do_deshit
bind pub m !users pub_do_users
bind pub m !bans pub_do_bans
bind pub o|o !slap pub_do_slap
bind pub m !status pub_do_status
bind pub n !reload pub_do_reload
bind pub n !rehash pub_do_rehash
bind pub n !restart pub_do_restart
bind pub n !die pub_do_die
bind pub -|o !mvoice pub_do_massv
bind pub -|o !mop pub_do_massop
bind pub -|m !refresh pub_do_hop
bind pub -|o !fishbot pub_do_invfishbot
bind pub n !join pub_do_join
bind pub n !part pub_do_part
bind msg -|m hop msg_do_hop
bind msg -|- slap msg_do_slap
bind mode - * mode_do_hop
bind join - * pub:join

setudef flag voiceall

#voice all ppl who join the channel
bind join - * pub:join
proc pub:join {nick uhost hand chan} {
if {[channel get $chan voiceall]} {
putserv "mode $chan +v $nick"
}
}
#end of pub:join

#add channel to bot
proc pub_do_join {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !join <#channel>"
return 1
}
if {[validchan $who]} {
putserv "NOTICE $nick :I'm on $who, lame."
return 1
}
channel add $who
set owna [nick2hand $nick $channel]
putserv "NOTICE $nick :Done: Added new channel: $who."
putserv "PRIVMSG $who :Hi! $who has been sucessfully added to Channel- Databaseby $nick."
chattr $owna |+amno $who
return 1
}
#end of pub_do_join

#part channel
proc pub_do_part {nick host handle channel testes} {
putserv "PRIVMSG $channel :$channel will now be deleted by $nick. Chow, Chow"
putserv "NOTICE $nick :Done: Removed from Channel-Database: $channel"
channel remove $channel
}
#end of pub_do_part

# Invites fishbot to #channel
proc pub_do_invfishbot {nick host handle channel testes} {
global fishbot owner
if {$fishbot == 1} {
if {[onchan fishbot $channel]} {
putserv "NOTICE $nick :Fishbot is here, lame. Let's NOT have a orgasim, if you do you can clean it..."
return 1
}
if {![onchan fisbot $channel]} {
putserv "INVITE fishbot $channel"
putserv "NOTICE $nick :Done: Invited fishbot to $channel by $nick."
}
}
if {$fishbot == 0} {
if {[matchattr $nick +n]} {
putserv "NOTICE $nick :This command is disabled. To enable, config your script dumbass."
return 1
}
putserv "NOTICE $nick :This command is disabled, if you want to use it tell it to $owner."
}
}
#end of pub_do_invfishbot

#mass voice
proc pub_do_massv {nick host hand chan arg} { 
foreach {who} [chanlist $chan] { 
if {![botisop $chan]} {
putserv "NOTICE $nick :I'm not op'd, dumbass."
}
if {[isop $who $chan] || [isvoice $who $chan]} { continue } 
pushmode $chan "+v" $who 
} 
flushmode $chan
putserv "NOTICE $nick :Done: Mass-voice on $chan"
}
#end of pub_do_massv

#mass op
proc pub_do_massop {nick host hand chan arg} { 
global fishbotop
foreach {who} [chanlist $chan] { 
if {![botisop $chan]} {
putserv "NOTICE $nick :I'm not op'd, Dumbass."
return 1
}
if {[isop $who $chan]} { continue } 
pushmode $chan "+o" $who 
} 
flushmode $chan 
putserv "NOTICE $nick :Done: Mass-op on $chan"
}
#end of pub_do_massop

#userlist
proc pub_do_users {nick uhost hand chan text} {  
     puthelp "NOTICE $nick :- \037\002User List\002\037"  
foreach {a b c d} [userlist $chan] {  
     puthelp "NOTICE $nick :- [format %-12s%-12s%-12s%-12s $a $b $c $d]" 
     } 
     puthelp "NOTICE $nick :- \037\002User List Completed\002\037" 
}
#end of userlist

#banlist
proc pub_do_bans {nick uhost hand chan text} {  
     puthelp "NOTICE $nick :- \037\002Ban List\002\037"  
foreach {a b c d} [banlist $chan] {  
     puthelp "NOTICE $nick :- [format %-12s%-12s%-12s%-12s $a $b $c $d]" 
     } 
     puthelp "NOTICE $nick :- \037\002Ban List Completed\002\037" 
}
#end of banlist

#Slap sbody on #channel
proc pub_do_slap {nick host handle channel testes} {  
global botnick slaps slapoutput randnum
set who [lindex [split $testes] 0]
if {[string tolower $who] == [string tolower $nick]} {
putserv "PRIVMSG $channel :Eh... Don't waste my time, slap yourself!"
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "PRIVMSG $channel :Eh, how funny..."
return 1
}
if {[matchattr $who +n]} {
putserv "PRIVMSG $channel :\001ACTION loves his owna'\001"
return 1
}
set randnum [expr [rand [expr (1000-500+1)]] + 500]
set slaps { 
	"drives over $who" 
	"shreds $who with a chainsaw" 
	"steals $who's cookies. mwahaha!" 
	"pushes $who into a crevasse" 
	"follows $who into a dark avenue. Hey test my crowbar!" 
	"persuades $who to eat the cyanide sandwich" 
	"slaps $who around a bit with a large trout" 
	"forgets $who in the desert. awww" 
	"is searching for $who + shitsex on yahoo. WEEE $randnum Hits!"
	"burns $who's house down"
	"throws a keyboard at $who"
	"beautifies $who with some knuckle duster imprints"
	"sends hordes of lemmings over $who"
	"slaps $who around with a pink Macintosh"
	"slaps $who around with nuclear waste"
	"throws a playstation at $who"
	"throws a green xbox at $who"
	"prepares $who to be shown on scatlover.com"
	"sneezes in $who's face"
	"stabs $who in the face"
	"slaps $who around a bit with a small Imperial-Class Stardestroyer"
	"discovers $who's picture at scatlover.com"
	"slaps $who around with Windows 3.1"
} 
set slapoutput [lindex $slaps [rand [llength $slaps]]]  
if {$who == ""} {  
putserv "NOTICE $nick :Usage: slap <nick>"  
return 1  
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Clean your glasses, Dumbass."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "PRIVMSG $channel :\001ACTION [subst $slapoutput]\001"
}
#end of pub_do_slap

#Slap sbody from msg
proc msg_do_slap {nick handle channel testes} {  
global botnick slaps slapoutput where randnum
set who [lindex [split $testes] 0]
set where [lindex $testes 1]
if {[string tolower $who] == [string tolower $nick]} {
putserv "PRIVMSG $where :Eh, funny... Don't waste my time, slap yourself!"
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "PRIVMSG $where :Eh, funny..."
return 1
}
if {[matchattr $who +n]} {
putserv "PRIVMSG $where :\001ACTION likes his owna'\001"
return 1
}
set randnum [expr [rand [expr (1000-500+1)]] + 500]
set slaps { 
	"drives over $who" 
	"shreds $who with a chainsaw" 
	"steals $who's cookies. mwahaha!" 
	"pushes $who into a crevasse" 
	"follows $who into a dark avenue. Hey test my crowbar!" 
	"persuades $who to eat the cyanide sandwich" 
	"slaps $who around a bit with a large trout" 
	"forgets $who in the desert. awww" 
	"is searching for $who + shitsex on yahoo. WEEE $randnum Hits!"
	"burns $who's house down"
	"throws a keyboard at $who"
	"beautifies $who with some knuckle duster imprints"
	"sends hordes of lemmings over $who"
	"slaps $who around with a pink Macintosh"
	"slaps $who around with nuclear waste"
	"throws a playstation at $who"
	"throws a green xbox at $who"
	"prepares $who to be shown on scatlover.com"
	"sneezes in $who's face"
	"stabs $who in the face"
	"slaps $who around a bit with a small Imperial-Class Stardestroyer"
	"discovers $who's picture at scatlover.com"
	"slaps $who around with Windows 3.1"
} 
set slapoutput [lindex $slaps [rand [llength $slaps]]]  
if {$who == ""} {  
putserv "NOTICE $nick :Usage: slap <nick> #channel"  
return 1  
}
if {![onchan $who $where]} {
putserv "NOTICE $nick :I can't see $who on $where! Change your glasses, lame."
return 1
} 
putserv "PRIVMSG $where :\001ACTION [subst $slapoutput]\001"
}
#end of msg_do_slap

# Adds user with flag +ao on #channel to the bot
proc pub_do_addop {nick host handle channel testes} {
set who [lindex $testes 0]
set ophost [getchanhost $who $channel]
set mhost [maskhost [getchanhost $who $channel]]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !addop <Nick to add>"
return 1
}
if {[matchattr [finduser [maskhost $ophost]] +o $channel] == 1} {
putserv "NOTICE $nick :$who is in oplist, lame."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Clean your glasses, Dumbass."
putserv "PRIVMSG $channel :eh.."
return 1
}
adduser $who $mhost
putserv "NOTICE $nick :Done: +ao $who on $channel."
set ophandle [nick2hand $who $channel]
chattr $ophandle +hp|+ao $channel
addhost $ophandle $mhost
}
#End of pub_do_addop

#Make the bot fake op someone (just cos it's fun! =))
proc pub_do_fakeop {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !fop <Nick you want to give fake ops.>"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, dumbass."
return 1
}

if {[isop $who $channel]} {
putserv "NOTICE $nick :$who is op'd on $channel, rectal cleaner."
return 1
} 
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Clean your glasses, Dumbass."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel +o $who"
putserv "MODE $channel -o $who"
putserv "PRIVMSG $channel :How'd it feel to have ops for about 1 second $who?"
putserv "NOTICE $nick :Done: Fake op $who on $channel."
}
#End of pub_do_fakeop

#Make the bot op someone
proc pub_do_op {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, Dumbass."
return 1
}
if {[isop $nick $channel]} {
putserv "NOTICE $nick :You are op'd on $channel, Gimplord.$nick now has the gimps "
return 1
}
putserv "MODE $channel +o $nick"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, gimpie."
return 1
}

if {[isop $who $channel]} {
putserv "NOTICE $nick :$who is op'd on $channel, Dumbass."
return 1
} 
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Clean your glasses, Gimp."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel +o $who"
putserv "NOTICE $nick :Done: Op $who on $channel."
}
#End of pub_do_op

#Make the bot halfop someone
proc pub_do_halfop {nick host handle channel testes} {
global usehalfop owner
set who [lindex $testes 0]
if {$usehalfop == 1} {
if {$who == ""} {
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, Dumbass."
return 1
}
if {[ishalfop $channel]} {
putserv "NOTICE $nick :You are halfop'd on $channel, GimpPage.$nick has been paged by the gimp."
return 1
}
putserv "MODE $channel +h $nick"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, Dumbass."
return 1
}

if {[ishalfop $who $channel]} {
putserv "NOTICE $nick :$who is halfop'd on $channel, lameass."
return 1
} 
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, degenerate."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel +h $who"
putserv "NOTICE $nick :Done: Halfop $who on $channel."
return 1
}
if {$usehalfop == 0} {
if {[matchattr $nick +n]} {
putserv "NOTICE $nick :Halfop isn't enabled. To enable, config your script."
return 1
}
putserv "NOTICE $nick :Halfop isn't enabled. If this server uses halfop, tell it to $owner"
}
}
#End of pub_do_halfop

#Make the bot voice someone
proc pub_do_voice {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, Think about it."
return 1
}
if {[isvoice $channel]} {
putserv "NOTICE $nick :You are voice'd on $channel, Thanks (Only Because I got laied)."
return 1
}
putserv "MODE $channel +v $nick"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, duhhhhh!."
return 1
}

if {[isvoice $who $channel]} {
putserv "NOTICE $nick :$who is voice'd on $channel, gitersquirt."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel +v $who"
putserv "NOTICE $nick :Done: Voice $who on $channel."
}
#End of pub_do_voice

#Make the bot say something..
proc pub_do_say {nick host handle channel testes} {
set who [lindex $testes 0] 
set why [lrange $testes 1 end] 
if {$who == ""} {
putserv "NOTICE $nick :Usage: !say <What you want me to say to the channel.>"
return 1
}
putserv "PRIVMSG $channel :$who $why"
putserv "NOTICE $nick :Done: say '$who $why' to $channel."
return 1
} 
#End of pub_do_say

#Change an existing users attributes
proc pub_do_chattr {nick host handle channel testes} {
set who [lindex $testes 0]
set why [lindex $testes 1]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !chattr <Changer Users attributes.>"
return 1
}
if {[matchattr $who +n]} {
putserv "NOTICE $nick :You can't change the owna's attributes!"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, dumbo."
return 1
}
set uhandle [nick2hand $who $channel]
if {uhandle == "*"} {
putserv "NOTICE $nick :$who isn't in user database."
return 1
}
chattr $uhandle $why
putserv "NOTICE $nick :Done: Add attribute $why to $who."
return 1
}
#End of pub_do_chattr

#Kickban someone 
proc pub_do_ban {nick host handle channel testes} {
global botnick
set why [lrange $testes 1 end]
set who [lindex $testes 0]
set ban [maskhost [getchanhost $who $channel]]
if {[string tolower $who] == [string tolower $botnick]} {
putserv "MODE $channel -o $nick"
putserv "PRIVMSG $channel :Think that's funny? Trying to make me kickban myself? Well goto hell and choke you gimpmuncher."
return 1 
}
if {$who == ""} {
putserv "NOTICE $nick :Usage: !kb <nick to bankick>"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, blowfish."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel +b $ban"
putserv "KICK $channel $who :$why"
putserv "NOTICE $nick :Done: Kick-Ban $who on $channel with reason: $why."
return 1
}
#End of pub_do_ban

#Delete a host from the banlist.
proc pub_do_unban {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: <Host to unban>"
return 1
}
putserv "MODE $channel -b $who"
putserv "NOTICE $nick :Done: Deleted $who from $channel banlist."
return 1
}
#end of pub_do_unban

#Remove host from shitlist
proc pub_do_deshit {nick host handle channel testes} {
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: <Shit to remove>"
return 1
}
killchanban $channel $who
putserv "NOTICE $nick :Done: Delete $who from shitlist of $channel."
return 1
}
#end of pub_do_deshit

#Publically ping the bot (just fun)
proc pub_do_ping {nick host handle channel testes} {
putserv "PRIVMSG $channel :PoNG!!!!!"
return 1
}
#end of pub_do_ping

#Change topic on channel
proc pub_do_topic {user host handle channel testes} {
set what [lrange $testes 0 end]
if {$what == ""} {
putserv "NOTICE $nick :Usage: !topic <Topic you want.>"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd on $channel dumbass you have to have me op first, duhhhhhhh."
return 1
}
putserv "TOPIC $channel :$what"
putserv "NOTICE $nick :Done: changed topic on $channel to $what now read it!."
return 1
}
#end of pub_do_topic

#Delete an user from the records.
proc pub_do_del {nick host handle channel testes} {
set who [lindex $testes 0]
if {[matchattr $who +n]} {
putserv "MODE $channel -o $nick"
putserv "PRIVMSG $channel :Trying to delete an owna' eh? Funny."
return 1
}
if {$who == ""} {
putserv "NOTICE $nick :Usage: <User to Delete>"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Clean your glasses, lameo."
putserv "PRIVMSG $channel :eh.."
return 1
} 
set thandle [nick2hand $who $channel]
if {$thandle == "*"} {
putserv "NOTICE $nick :$who isn't in user database."
return 1
}
deluser $thandle
putserv "NOTICE $nick :Done: Deleted $who from User-Database."
return 1
}
#end of pub_do_del

#Deop someone
proc pub_do_deop {nick host handle channel testes} {
global botnick
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !deop <Nick to Deop>"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, lamer."
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "MODE $channel -o $nick"
putserv "PRIVMSG $channel :Think that's funny ? Trying to make me deop myself ? Well goto hell and far on fire you,you,you... When I think of somthing I will call you it... Oh ya Dumbass!"
return 1
}
if {[string tolower $who] == [string tolower $nick]} {
putserv "PRIVMSG $channel :I donno why you'r so lame to want to deop yourself $nick, but i'm gonna do it."
putserv "MODE $channel -o $nick"
return 1
}
if {[matchattr $who +n]} {
putserv "MODE $channel -o $nick"
putserv "PRIVMSG $channel :I aint deopin my owna'!"
return 1
}
if {![isop $who $channel]} {
putserv "NOTICE $nick :$who is already deop'd, clean your glasses."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lamen."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel -o $who"
putserv "NOTICE $nick :Done: Deop $who on $channel."
return 1
}
#end of pub_do_deop

#Dehalfop someone
proc pub_do_dehalfop {nick host handle channel testes} {
global botnick
set who [lindex $testes 0]
if {$usehalfop == 1} {
if {$who == ""} {
putserv "NOTICE $nick :Usage: !dehalfop <Nick to Devoice>"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, lame."
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "MODE $channel -h $nick"
putserv "PRIVMSG $channel :Think that's funny? Trying to make me dehalfop myself? Well goto hell!."
return 1
}
if {[string tolower $who] == [string tolower $nick]} {
putserv "PRIVMSG $channel :I donno why you'r so lame to want to dehalfop yourself $nick, but i'm gonna do it."
putserv "MODE $channel -h $nick"
return 1
}
if {[matchattr $who +n]} {
putserv "MODE $channel -h $nick"
putserv "PRIVMSG $channel :I aint dehalfopin my owna'!"
return 1
}
if {![ishalfop $who $channel]} {
putserv "NOTICE $nick :$who is already dehalfop'd."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel -h $who"
putserv "NOTICE $nick :Done: Dehalfop $who on $channel."
return 1
}
if {$usehalfop == 0} {
if {[matchattr $nick +n]} {
putserv "NOTICE $nick :Halfop isn't enabled. To enable, config your script."
return 1
}
putserv "NOTICE $nick :Halfop isn't enabled. If this server uses halfop, tell it to $owner"
}
}
#end of pub_do_dehalfop

#Devoice someone
proc pub_do_devoice {nick host handle channel testes} {
global botnick
set who [lindex $testes 0]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !devoice <Nick to Devoice>"
return 1
}
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd, lame."
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "MODE $channel -v $nick"
putserv "PRIVMSG $channel :Think that's funny? Trying to make me devoice myself? Well goto hell you lame."
return 1
}
if {[string tolower $who] == [string tolower $nick]} {
putserv "PRIVMSG $channel :I donno why you'r so lame to want to devoice yourself $nick, but i'm gonna do it."
putserv "MODE $channel -v $nick"
return 1
}
if {[matchattr $who +n]} {
putserv "MODE $channel -v $nick"
putserv "PRIVMSG $channel :I aint devoicin my owna'!"
return 1
}
if {![isvoice $who $channel]} {
putserv "NOTICE $nick :$who is already devoice'd."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "MODE $channel -v $who"
putserv "NOTICE $nick :Done: Devoice $who on $channel."
return 1
}
#end of pub_do_devoice

#Kick someone
proc pub_do_kick {nick host handle channel testes} {
global botnick
set who [lindex $testes 0]
set why [lrange $testes 1 end]
if {[string tolower $who] == [string tolower $botnick]} {
putserv "KICK $channel $nick :Eh, funny."
return 1
}
if {$who == ""} {
putserv "NOTICE $nick :Usage: !k <nick to kick>"
return 1
}
if {$who == $nick} {
putserv "PRIVMSG $channel :Why the hell do you want to kick yourself $nick?"
return 1
}
if {[matchattr $who +n]} {
putserv "KICK $channel $nick :Trying to kick an owna' eh?"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "KICK $channel $who :$why (kick by $nick)"
putserv "NOTICE $nick :Done: Kick $who from $channel with reason: $why."
return 1
}
#End of pub_do_kick

#Permban someone
proc pub_do_pban {nick host handle channel testes} {
global botnick
set why [lrange $testes 1 end]
set who [lindex $testes 0]
set ban [maskhost [getchanhost $who $channel]]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !shit <Nick to shitlist>"
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "KICK $channel $nick :Eh, funny."
return 1
}
if {[matchattr $who +n]} {
putserv "NOTICE $who :$nick tried to shitlist you. Better have a talk with him."
putserv "NOTICE $nick :You tried to shitlist $who, He's the owna'! I tell it him now..."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
newchanban $channel $ban $nick $why
stick $ban $channel
putserv "KICK $channel $who :$why (shitlisted by $nick)"
putserv "NOTICE $nick :Done: Shitlist $who on $channel with reason: $why."
return 1
}
#end of pub_do_pban

#Set the bot away.
proc pub_do_away {nick host handle channel testes} {
set why [lrange $testes 0 end]
if {$why == ""} {
putserv "NOTICE $nick :!away <away msg>"
return 1
}
putserv "AWAY :$why"
putserv "NOTICE $nick :Done: Set away with reason: $why."
return 1
}
#end of pub_do_away

#Set the bot back.
proc pub_do_back {nick host handle channel testes} {
putserv "AWAY :"
putserv "NOTICE $nick :Done: Back from away."
}
#end of pub_do_back

#Make the bot MSG someone...
proc pub_do_msg {nick host handle channel testes} {
set who [lindex $testes 0]
set why [lrange $testes 1 end]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !msg <nick> <message>"
return 1
}
putserv "PRIVMSG $who :$why"
putserv "NOTICE $nick :Done: Msg $who with: $why"
return 1
}
#end of pub_do_msg

#Add a user to the bot
proc pub_add_user {nick host handle channel testes} {
set who [lindex $testes 0]
set thost [getchanhost $who $channel]
set mhost [maskhost [getchanhost $who $channel]]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !adduser <User to Add.>"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
adduser $who $mhost
putserv "NOTICE $nick :Done: Add $who to User-Database."
set thandle [nick2hand $who $channel]
chattr $thandle +hp
addhost $thandle $mhost
return 1
}
#end of pub_add_user

#Add a MASTER to the bot.
proc pub_do_addm {nick host handle channel testes} {
set who [lindex $testes 0]
set masterhost [getchanhost $who $channel]
set mhost [maskhost [getchanhost $who $channel]]
if {$who == ""} {
putserv "NOTICE $nick :Usage: !addm <Nick to add>"
return 1
}
if {[matchattr [finduser [maskhost $masterhost]] +m $channel] == 1} {
putserv "NOTICE $nick :$who is a master, lame."
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
}
adduser $who $mhost
putserv "NOTICE $nick :Done: +amo $who on $channel."
set ophandle [nick2hand $who $channel]
chattr $ophandle +hp|+amo $channel
addhost $ophandle $mhost
}
#End of pub_do_addm

#Make he bot fuck someone (just 4 fun)
proc pub_do_fuck {nick host handle channel testes} {
global botnick dofuck owner
set who [lindex $testes 0]
if {$dofuck == 1} {
if {$who == ""} {
if {[matchattr $nick +n]} {
putserv "PRIVMSG $channel :I don't wanna fuck ya, mummy."
return 1
}
putserv "PRIVMSG $channel :Get lost ya fuckin' asshole!"
return 1
}
if {[string tolower $who] == [string tolower $botnick]} {
putserv "MODE $channel -o $nick"
putserv "PRIVMSG $channel :Haha, I don't wanna fuck myself, asshole."
return 1
}
if {[matchattr $who +n]} {
putserv "PRIVMSG $channel :I don't wanna fuck my owna'. Get lost $nick."
putserv "MODE $channel -o $nick"
return 1
}
if {![onchan $who $channel]} {
putserv "NOTICE $nick :I can't see $who on $channel! Change your glasses, lame."
putserv "PRIVMSG $channel :eh.."
return 1
} 
putserv "PRIVMSG $channel :Get lost $who, ya fuckin' asshole."
return 1
}
if {$dofuck == 0} {
if {[matchattr $nick +n]} {
putserv "NOTICE $nick :Fuckin' isn't enabled. To enable, config your script."
return 1
}
putserv "NOTICE $nick :Fuckin' isn't enabled. If you want to use this bad word, tell it to $owner"
}
}
#End of pub_do_fuck

#Change the mode in the channel
proc pub_do_mode {nick host handle channel testes} {
set who [lindex $testes 0]
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not op'd on $channel."
return 1
}
if {$who == ""} {
putserv "NOTICE $nick :Usage: !mode <Channel mode you want to set>"
return 1
}
putserv "MODE $channel $who"
putserv "NOTICE $nick :Done: Set mode on $channel $who."
return 1
}
#end of pub_do_mode

#change channel settings
proc pub_do_ccs {nick host handle channel testes} {
global botnick
set why [lrange $testes 0 end]
if {$why == ""} {
putserv "NOTICE $nick :Usage :!ccs <channel> <settings> :Valid settings are + means yes, - means no :autoop, clearbans, enforcebans, dynamicbans, userbans, bitch, greet, protectops and statuslog. " 
return 1
}
channel set $channel $why
putserv "NOTICE $nick :Done: Change settings on $channel to $why."
return 1
}
#End of pub_do_ccs

#shows the current server
proc pub_do_srv {nick host handle channel testes} {
global server
putserv "PRIVMSG $channel :I'm currently on $server."
return 1
}
#end of pub_do_srv

#shows the current time
proc pub_do_time {nick host handle channel testes} {
set who [time]
putserv "PRIVMSG $channel :The current time is $who"
return 1
}
#end of pub_do_time

#version 
proc pub_say_ver {nick host handle channel testes} {
global version
putserv "PRIVMSG $nick :I'm a $version."
return 1
}
#end of pub_do_ver

#make the bot tell you the date
proc pub_do_date {nick host handle channel testes} {
set who [date]
putserv "PRIVMSG $channel :Today is: $who."
return 1
}
#end of pub_do_date

#kill the bot
proc pub_do_die {nick host handle channel testes} {
set why [lrange $testes 0 end]
	if {[matchattr $nick +n]} {
	putserv "NOTICE $nick :Done: Die with reason: $why"
	die $why
}
}

#end of pub_do_die

# rehash the bot
proc pub_do_rehash {nick host handle channel testes} {
	if {[matchattr $nick +n]} {
	rehash
	putserv "NOTICE $nick :Done: Rehash."
}
}
#end of pub_do_rehash

# reload the userfile
proc pub_do_reload {nick host handle channel testes} {
	if {[matchattr $nick +n]} {
	reload
	putserv "NOTICE $nick :Done: Reload."
}
}

# restart the bot
proc pub_do_restart {nick host handle channel testes} {
	if {[matchattr $nick +n]} {
	putserv "NOTICE $nick :Restarting..."
	restart
}
}
#end of pub_do_restart

#tell the status
proc pub_do_status {nick host handle channel testes} {
	global server botname version owner
	putserv "notice $nick :\002---Bot statistics:---\002"
	putserv "notice $nick :User records: [countusers]"
	putserv "notice $nick :My channels: [channels]"
	putserv "notice $nick :My date: [date]"
	putserv "notice $nick :My time: [time]"
	putserv "notice $nick :My operating system: [unames]"
	putserv "notice $nick :My server: $server"
	putserv "notice $nick :My host: $botname"
	putserv "notice $nick :My version: Eggdrop [lindex $version 0]"
       putserv "notice $nick :My owner: $owner"
	putserv "notice $nick :\002---End of statisctics---\002"
}
#end of pub_do_status

#Make rejoin the bot from #channel
proc pub_do_hop { nick uhost hand chan text } {
 putserv "PART :$chan"
 putserv "JOIN :$chan"
 putserv "NOTICE $nick :Done: Rejoin $chan."
}
#end of pub_do_hop

#make rejoin the bot from privmsg
proc msg_do_hop { nick uhost hand text } {
 putserv "PART :$text"
 putserv "JOIN :$text"
 putserv "NOTICE $nick :Done: Rejoin $chan."
}
#end of msg_do_hop

proc mode_do_hop { nick uhost hand chan mc vict } {
global hopondeop kickondeop botnick owner
if {$mc == "-o" && $vict == $botnick && $hopondeop == 1} {
 putlog "Hopping channel $chan due to deop"
 putserv "PRIVMSG $chan :"
 putserv "PART :$chan"
 putserv "JOIN :$chan"
 putserv "PRIVMSG $chan :"
  if {$nick != $owner && $kickondeop == 1} {
   putserv "KICK $chan $nick"
}
}
}

############################################################################################
################################ E N D   O F   S C R I P T  ################################
############################################################################################