################################## # hanikegg.tcl # Author : H4_Kim # Email : h4_kim@tulungagung.net ################################## # Petunjuk Pemakaian : # Public Command (channel) gunakan "`" # Command Msg Bot , ketikkan "help" (owner only) ################################## # Variabel yang bisa di ubah : set CC "`" set timezone "PST" set nopart "" set topicnick 0 set greetflag G set min 5 set pubcommands 1 set mastercommands 1 set ownercommands 1 set moredcc 1 set combot 1 set funny_stuff 1 set rrated_funny_stuff 1 set path "[pwd]/" ############# DON'T CHANGE BELOW THIS LINE!!!! ############# if {$numversion < 1030700} { putlog "*** Can't load hanikegg -- At least Eggdrop v1.3.7 required" return 0 } set thepath $path set newpath $path set greetfile "${nick}.greet" set emailfile "${nick}.email" set urlfile "${nick}.url" if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"} if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"} if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"} foreach x [timers] { if {[lindex $x 1] == "HanikEgg_autosave"} { killtimer [lindex $x 2] } } #foreach u [utimers] { # if {[lindex $u 1] == "hanikegg_check"} { # killutimer [lindex $u 2] # } #} bind join G|G * join_greet bind dcc p|p flhelp dcc_flhelp bind dcc p|p FLHelp dcc_flhelp bind pub p|p ${CC}flhelp pub_flhelp bind pub p|p ${CC}FLHelp pub_flhelp bind pub p|p ${CC}about pub_about bind dcc p|p about dcc_about bind pub p|p ${CC}version pub_version bind dcc p|p version dcc_version bind msg p|p auth msg_auth bind msg p|p deauth msg_deauth bind sign p|p * sign_deauth bind part p|p * part_deauth proc botname {} {global botname;return $botname} if {$pubcommands==1} { bind pub p|p ${CC}echo pub_echo bind pub p|p ${CC}seen pub_seen bind pub p|p ${CC}who pub_who bind pub p|p ${CC}whois pub_whois bind pub p|p ${CC}wi pub_whois bind pub p|p ${CC}whom pub_whom bind pub o|o ${CC}match pub_match bind pub p|p ${CC}bots pub_bots bind pub p|p ${CC}bottree pub_bottree bind pub p|p ${CC}notes pub_notes bind pub o ${CC}+ban pub_+ban bind pub o ${CC}kb pub_kb bind pub o ${CC}kickban pub_kb bind pub o ${CC}-ban pub_-ban bind pub o ${CC}bans pub_bans bind pub o ${CC}resetbans pub_resetbans bind pub o|o ${CC}op pub_op bind pub o|o ${CC}deop pub_deop bind pub o|o ${CC}topic pub_topic bind pub o|o ${CC}act pub_act bind pub o|o ${CC}say pub_say bind pub o|o ${CC}msg pub_msg bind pub o|o ${CC}motd pub_motd bind pub o|o ${CC}addlog pub_addlog bind pub o|o ${CC}invite pub_invite bind pub o|o ${CC}nick pub_nick bind pub o|o ${CC}away pub_away bind pub o|o ${CC}back pub_back bind pub p|p ${CC}note pub_note bind pub x|x ${CC}files pub_files bind pub p|p ${CC}newpass pub_newpass bind pub o|o ${CC}console pub_console bind pub p|p ${CC}quit pub_quit bind pub o|o ${CC}servers pub_servers bind pub p|p ${CC}info pub_info bind pub x|x ${CC}get pub_get bind pub p|p ${CC}botinfo pub_botinfo bind pub p|p ${CC}chat pub_chat bind pub p|p ${CC}channel pub_channel bind pub p|p ${CC}time pub_time bind pub o|o ${CC}kick pub_kick bind pub p|o ${CC}k pub_k bind pub p|p ${CC}channels pub_channels bind pub o|o ${CC}botinfo pub_botinfo bind pub o|o ${CC}trace pub_trace bind pub o|o ${CC}stick pub_stick bind pub o|o ${CC}unstick pub_unstick bind pub o|o ${CC}su pub_su bind pub p|p ${CC}page pub_page bind pub p|p ${CC}help pub_help bind pub p|p ${CC}comment pub_comment bind pub o|o ${CC}-b mode_-b bind pub o|o ${CC}+b mode_+b bind pub o|o ${CC}+t mode_+t bind pub o|o ${CC}+n mode_+n bind pub o|o ${CC}+s mode_+s bind pub o|o ${CC}+i mode_+i bind pub o|o ${CC}+p mode_+p bind pub o|o ${CC}+m mode_+m bind pub o|o ${CC}+k mode_+k bind pub o|o ${CC}+l mode_+l bind pub o|o ${CC}+voice mode_+v bind pub o|o ${CC}-voice mode_-v bind pub o|o ${CC}+v mode_+v bind pub o|o ${CC}-v mode_-v bind pub o|o ${CC}+h mode_+h bind pub o|o ${CC}-h mode_-h bind pub o|o ${CC}-t mode_-t bind pub o|o ${CC}-s mode_-s bind pub o|o ${CC}-l mode_-l bind pub o|o ${CC}-k mode_-k bind pub o|o ${CC}-m mode_-m bind pub o|o ${CC}-i mode_-i bind pub o|o ${CC}-n mode_-n bind pub o|o ${CC}-p mode_-p bind pub o|o ${CC}auth pub_auth bind pub p|p ${CC}email pub_email bind pub p|p ${CC}url pub_url bind pub p|p ${CC}greet pub_greet bind pub p|p ${CC}userinfo pub_userinfo bind pub p|p ${CC}ui pub_userinfo } if {$mastercommands==1} { bind pub m ${CC}adduser pub_adduser bind pub m ${CC}+user pub_+user bind pub m ${CC}-user pub_-user bind pub m ${CC}deluser pub_deluser bind pub m ${CC}+bot pub_+bot bind pub m ${CC}-bot pub_-bot bind pub p ${CC}+host pub_+host bind pub p ${CC}-host pub_-host bind pub m ${CC}chattr pub_chattr bind pub m ${CC}save pub_save bind pub m ${CC}chpass pub_chpass bind pub m ${CC}chinfo pub_chinfo bind pub m ${CC}chnick pub_chnick bind pub m ${CC}chcomment pub_chcomment bind pub m ${CC}+ignore pub_+ignore bind pub m ${CC}-ignore pub_-ignore bind pub m ${CC}ignores pub_ignores bind pub m ${CC}reload pub_reload bind pub m ${CC}jump pub_jump bind pub m ${CC}rehash pub_rehash bind pub m ${CC}restart pub_restart bind dcc m join cmd_join bind pub m ${CC}join pub_join bind dcc m part cmd_part bind pub m ${CC}part pub_part bind dcc m global cmd_global bind pub m ${CC}chaddr pub_chaddr bind pub m ${CC}filestats pub_filestats bind pub m ${CC}fixcodes pub_fixcodes bind pub m ${CC}strip pub_strip bind pub m ${CC}link pub_link bind pub m ${CC}unlink pub_unlink bind pub m ${CC}chbotattr pub_chbotattr bind pub m ${CC}assoc pub_assoc bind pub m ${CC}status pub_status bind pub m ${CC}chaninfo pub_chaninfo bind pub m ${CC}boot pub_boot bind pub m ${CC}relay pub_relay bind pub m ${CC}set pub_set bind pub m ${CC}flush pub_flush bind pub m ${CC}banner pub_banner bind pub m ${CC}reset pub_reset bind pub m ${CC}binds pub_binds bind pub m ${CC}dump pub_dump bind pub m ${CC}debug pub_debug bind pub m ${CC}+chrec pub_+chrec bind pub m ${CC}-chrec pub_-chrec bind pub m ${CC}dccstat pub_dccstat bind pub m ${CC}botattr pub_botattr bind pub m ${CC}chemail pub_cchemail bind pub m ${CC}churl pub_churl bind pub m ${CC}chgreet pub_chgreet bind dcc m chemail dcc_chemail bind dcc m churl dcc_churl bind dcc m chgreet dcc_chgreet bind pub m ${CC}chemail pub_chemail bind pub m ${CC}churl pub_churl bind pub m ${CC}chgreet pub_chgreet } if {$ownercommands==1} { bind dcc n botnick dcc_botnick bind pub n ${CC}botnick pub_botnick bind pub n ${CC}die pub_die bind pub n ${CC}chanset pub_chanset bind pub n ${CC}chansave pub_chansave bind pub n ${CC}chanload pub_chanload bind pub n ${CC}+chan pub_+chan bind pub n ${CC}-chan pub_-chan bind pub n ${CC}simul pub_simul bind pub n ${CC}modules pub_modules bind pub n ${CC}loadmodule pub_loadmodule bind pub n ${CC}unloadmodule pub_unloadmodule bind dcc n flsave dcc_flsave } if {$moredcc==1} { bind dcc o|o userlist cmd_userlist bind dcc p|p channels cmd_channels bind dcc o|o flagnote cmd_flagnote bind dcc o|o say cmd_say bind dcc o|o act cmd_act bind dcc o|o addlog cmd_addlog bind dcc o|o op cmd_op bind dcc o|o deop cmd_deop bind dcc m aop cmd_aop bind dcc m raop cmd_raop bind dcc o|o match dcc_match bind filt p \001ACTION*\001 cmd_action bind dcc p|p email dcc_email bind dcc p|p url dcc_url bind dcc p|p greet dcc_greet bind dcc p|p userinfo dcc_userinfo bind dcc p|p ui dcc_userinfo bind dcc p|p wi dcc_wi } if {$combot==1} { bind pub m ${CC}aop pub_aop bind pub m ${CC}raop pub_raop bind pub o|o ${CC}userlist pub_userlist bind pub o|o ${CC}me pub_me bind pub o|o up pub_up bind pub o|o ${CC}up pub_up bind pub o|o down pub_down bind pub o|o ${CC}down pub_down bind pub p|p ${CC}pong pub_pong bind pub p|p ${CC}ping pub_ping bind pub p|p ${CC}access pub_access bind dcc p|p access dcc_access bind pub -|- rollcall pub_rollcall bind pub -|- ${CC}rollcall pub_rollcall bind pub m ${CC}massunban pub_massunban bind pub m ${CC}mub pub_massunban bind dcc m massunban dcc_massunban bind dcc m mub dcc_mub bind dcc m massdeop dcc_massdeop bind dcc m massop dcc_massop bind dcc m mdeop cmd_mdeop bind dcc m mop cmd_mop bind pub m ${CC}massdeop pub_massdeop bind pub m ${CC}massop pub_massop bind pub m ${CC}mop pub_massop bind pub m ${CC}mdeop pub_massdeop } if {$funny_stuff==1} { bind pub p|p ${CC}pez pub_pez bind pub p|p ${CC}ramen pub_ramen } if {$rrated_funny_stuff==1} { bind pub p|p ${CC}beer pub_beer bind pub p|p ${CC}drug pub_drug } ## modes via pubic cmd -- start proc mode_+h {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+h " return 0 } if {[onchan $rest $chan] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not on the channel." return 0 } if {[onchan $rest $chan] == 1} { pushmode $chan +h $rest } } proc mode_-h {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-h " return 0 } if {[onchan $rest $chan] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not on the channel." return 0 } if {[onchan $rest $chan] == 1} { pushmode $chan -h $rest } } proc mode_+v {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+v " return 0 } if {[onchan $rest $chan] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not on the channel." return 0 } if {[isvoice $rest $chan] == 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already +v" } if {[onchan $rest $chan] == 1} { pushmode $chan +v $rest } } proc mode_-v {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-v " return 0 } if {[onchan $rest $chan] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not on the channel." return 0 } if {[isvoice $rest $chan] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already -v" } if {[onchan $rest $chan] == 1} { pushmode $chan -v $rest } } proc mode_+t {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +t } proc mode_-t {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -t } proc mode_+s {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +s-p } proc mode_-s {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -s } proc mode_+p {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +p-s } proc mode_-p {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -p } proc mode_+n {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +n } proc mode_-n {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -n } proc mode_+i {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +i } proc mode_-i {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -i } proc mode_+m {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan +m } proc mode_-m {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -m } proc mode_+l {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+l " return 0 } pushmode $chan +l $rest } proc mode_-l {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -l $rest } proc mode_+k {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+k " return 0 } pushmode $chan +k $rest } proc mode_-k {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } pushmode $chan -k $rest } proc mode_+b {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+b " return 0 } pushmode $chan +b $rest } proc mode_-b {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-b " return 0 } pushmode $chan -b $rest } ## modes via pubic cmd -- stop ## public cmd echo -- start proc pub_echo {nick uhost hand chan rest} { global botnick version CC puthelp "NOTICE $nick :\002\[HanikEgg\]\002 echo is only available via dcc chat." } ## msg cmd auth -- start proc msg_auth {nick uhost hand rest} { global botnick set pw [lindex $rest 0] if {$pw == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: /msg $botnick auth " return 0 } if {[matchattr $hand Q] == 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You are already Authenticated." return 0 } set ch [passwdok $hand ""] if {$ch == 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No password set. Type /msg $botnick pass " return 0 } if {[passwdok $hand $pw] == 1} { chattr $hand +Q putcmdlog "\002\[HanikEgg\]\002 #$hand# auth ..." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Authentication successful!" } if {[passwdok $hand $pw] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Authentication failed!" } } ## msg cmd auth -- stop ## msg cmd deauth -- start proc msg_deauth {nick uhost hand rest} { global botnick if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: /msg $botnick auth " return 0 } if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You never authenticated." return 0 } if {[passwdok $hand $rest] == 1} { chattr $hand -Q putcmdlog "\002\[HanikEgg\]\002 #$hand# deauth ..." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 DeAuthentication successful!" } if {[passwdok $hand $rest] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 DeAuthentication failed!" } } ## msg cmd deauth -- stop ## sign cmd deauth -- start proc sign_deauth {nick uhost hand chan rest} { if {[matchattr $hand Q] == 1} { chattr $hand -Q putlog "\002\[HanikEgg\]\002 $nick has signed off, automatic deauthentication." } if {[matchattr $hand Q] == 0} { return 0 } } ## sign cmd deauth -- stop ## part cmd deauth -- start proc part_deauth {nick uhost hand chan rest} { if {[matchattr $hand Q] == 1} { chattr $hand -Q putlog "\002\[HanikEgg\]\002 $nick has parted $chan, automatic deauthentication." } if {[matchattr $hand Q] == 0} { return 0 } } ## part cmd deauth -- stop ## public cmd about -- start proc pub_about {nick uhost hand chan rest} { global vers putcmdlog "\002\[HanikEgg\]\002 #$hand# about HanikEgg.tcl" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 HanikEgg.tcl by primo on irc.allnetwork.org " } ## public cmd about -- stop ## public cmd version -- start proc pub_version {nick uhost hand chan rest} { putcmdlog "\002\[HanikEgg\]\002 #$hand# version" global vers puthelp "NOTICE $nick :\002\[HanikEgg\]\002 EchiEgg.tcl ©2006 by primo on irc.allnetwork.org" } ## public cmd version -- stop ## public cmd help -- start proc pub_help {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 help is only available via dcc chat." } ## public cmd help -- stop ## public cmd FLHelp -- start proc pub_flhelp {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 FLHelp is only available via dcc chat." } ## public cmd FLHelp -- stop ## dcc cmd FLHelp -- start proc dcc_flhelp {hand idx args} { global botnick version vers set FL "\002\[HanikEgg\]\002" set args [lindex $args 0] global CC NC if {$args == ""} { putdcc $idx "$FL \26HanikEgg.tcl\26 ${vers}, Author Kindred " putdcc $idx "$FL PUBLIC COMMANDS for $botnick, eggdrop v[lindex $version 0]" putdcc $idx "$FL MY DCC CMD CHAR IS: \002'\002.\002'\002 MY PUBLIC CMD CHAR IS: \002'\002${CC}\002'\002" putdcc $idx "$FL" putdcc $idx "$FL \002\[\002\037For partyline users\037\002\]\002" putdcc $idx "$FL ping access version time" putdcc $idx "$FL pong rollcall about seen" if {[matchattr $hand o] == 1} { putdcc $idx "$FL \002\[\002\037For channel ops\037\002\]\002" putdcc $idx "$FL who +ban say away quit" putdcc $idx "$FL whom -ban msg back servers" putdcc $idx "$FL whois ban act note channel" putdcc $idx "$FL match bans me files kick" putdcc $idx "$FL bots addlog newpass su k" putdcc $idx "$FL bottree op invite console kickban" putdcc $idx "$FL notes deop nick email kb" putdcc $idx "$FL echo up stick unstick info" putdcc $idx "$FL trace down filestats page strip" putdcc $idx "$FL topic fixcodes userlist flagnote comment" putdcc $idx "$FL chat botinfo motd modes info" putdcc $idx "$FL wi ui" } if {[matchattr $hand m] == 1} { putdcc $idx "$FL \002\[\002\037For masters\037\002\]\002" putdcc $idx "$FL adduser +host chattr save reload" putdcc $idx "$FL deluser -host status boot chaninfo" putdcc $idx "$FL +bot botattr chnick chpass chinfo" putdcc $idx "$FL -bot link unlink chaddr chcomment" putdcc $idx "$FL +user set jump dump +ignores" putdcc $idx "$FL -user flush dccstat debug -ignores" putdcc $idx "$FL join aop +chrec reset ignores" putdcc $idx "$FL part raop -chrec rehash restart" putdcc $idx "$FL massop mop massunban boot banner" putdcc $idx "$FL massdeop mdeop mub assoc relay" putdcc $idx "$FL botattr" } if {[matchattr $hand n] == 1} { putdcc $idx "$FL \002\[\002\037For owners\037\002\]\002" putdcc $idx "$FL chanset chansave chanload simul" putdcc $idx "$FL +chan -chan die botnick" putdcc $idx "$FL modules loadmodule unloadmodule" } putdcc $idx "$FL All of these commands are available in the channel and in dcc chat." return 0 } if {[string tolower $args] == "kb"} { putcmdlog "$FL #$hand# FLHelp kb" putdcc $idx "$FL \#\#\# kb" putdcc $idx "$FL kickbans a user off of the channel." return 0 } if {[string tolower $args] == "chcomment"} { putcmdlog "$FL #$hand# FLHelp chcomment" putdcc $idx "$FL \#\#\# chcomment" putdcc $idx "$FL Allows masters/owners to set users comment line." return 0 } if {[string tolower $args] == "seen"} { putcmdlog "$FL #$hand# FLHelp seen" putdcc $idx "$FL \#\#\# seen" putdcc $idx "$FL Gives the last time a user was on the channel." return 0 } if {[string tolower $args] == "time"} { putcmdlog "$FL #$hand# FLHelp time" putdcc $idx "$FL \#\#\# time" putdcc $idx "$FL Gives the user the current time according to the bots location." return 0 } if {[string tolower $args] == "mdeop"} { putcmdlog "$FL #$hand# FLHelp mdeop" putdcc $idx "$FL \#\#\# mdeop" putdcc $idx "$FL MassDeops all non-ops on the channel." return 0 } if {[string tolower $args] == "mop"} { putcmdlog "$FL #$hand# FLHelp mop" putdcc $idx "$FL \#\#\# mop" putdcc $idx "$FL MassOps all non-ops on the channel." return 0 } if {[string tolower $args] == "massdeop"} { putcmdlog "$FL #$hand# FLHelp massdeop" putdcc $idx "$FL \#\#\# massdeop" putdcc $idx "$FL MassDeops all non-ops on the channel." return 0 } if {[string tolower $args] == "massop"} { putcmdlog "$FL #$hand# FLHelp massop" putdcc $idx "$FL \#\#\# massop" putdcc $idx "$FL MassOps all non-ops on the channel." return 0 } if {[string tolower $args] == "mub"} { putcmdlog "$FL #$hand# FLHelp mub" putdcc $idx "$FL \#\#\# mub" putdcc $idx "$FL Removes all bans currently set on the channel." return 0 } if {[string tolower $args] == "massunban"} { putcmdlog "$FL #$hand# FLHelp massunban" putdcc $idx "$FL \#\#\# massunban" putdcc $idx "$FL Removes all bans currently set on the channel." return 0 } if {[string tolower $args] == "about"} { putcmdlog "$FL #$hand# FLHelp about" putdcc $idx "$FL \#\#\# about" putdcc $idx "$FL About EchiEgg.tcl" return 0 } if {[string tolower $args] == "version"} { putcmdlog "$FL #$hand# FLHelp version" putdcc $idx "$FL \#\#\# version" putdcc $idx "$FL EchiEgg.tcl verion" return 0 } if {[string tolower $args] == "back"} { putcmdlog "$FL #$hand# FLHelp back" putdcc $idx "$FL \#\#\# back" putdcc $idx "$FL Back states that your bot is back after being away" putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "down"} { putcmdlog "$FL #$hand# FLHelp down" putdcc $idx "$FL \#\#\# down" putdcc $idx "$FL bot deops you on the channel." putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "up"} { putcmdlog "$FL #$hand# FLHelp up" putdcc $idx "$FL \#\#\# up" putdcc $idx "$FL bot ops on the channel." putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "userlist"} { putcmdlog "$FL #$hand# FLHelp userlist" putdcc $idx "$FL \#\#\# userlist" putdcc $idx "$FL \#\#\# userlist " putdcc $idx "$FL Lists all users currently on the bot" return 0 } if {[string tolower $args] == "ping"} { putcmdlog "$FL #$hand# FLHelp ping" putdcc $idx "$FL \#\#\# ping" putdcc $idx "$FL Shows bot response time." putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "pong"} { putdcc $idx "$FL \#\#\# pong" putcmdlog "$FL #$hand# FLHelp pong" putdcc $idx "$FL Shows bot response time" putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "access"} { putcmdlog "$FL #$hand# FLHelp access" putdcc $idx "$FL \#\#\# acess" putdcc $idx "$FL \#\#\# access " putdcc $idx "$FL shows user flags currently enabled." return 0 } if {[string tolower $args] == "rollcall"} { putcmdlog "$FL #$hand# FLHelp rollcall" putdcc $idx "$FL \#\#\# rollcall" putdcc $idx "$FL shows bots command char \& shows current bot version." putdcc $idx "$FL (only available via PUBLIC CMD)" return 0 } if {[string tolower $args] == "aop"} { putcmdlog "$FL #$hand# FLHelp aop" putdcc $idx "$FL \#\#\# aop " putdcc $idx "$FL aop Auto-op's a user when they enter a channel." return 0 } if {[string tolower $args] == "raop"} { putcmdlog "$FL #$hand# FLHelp raop" putdcc $idx "$FL \#\#\# raop " putdcc $idx "$FL Removes user's auto-op privilege." return 0 } if {[string tolower $args] == "botnick"} { putcmdlog "$FL #$hand# FLHelp botnick" putdcc $idx "$FL \#\#\# botnick " putdcc $idx "$FL changes the bots irc nick - \002\037NOT\037\002 botnet nick." return 0 } if {[string tolower $args] == "join"} { putcmdlog "$FL #$hand# FLHelp join" putdcc $idx "$FL \#\#\# join <#channel>" putdcc $idx "$FL Forces the bot to join a channel" return 0 } if {[string tolower $args] == "part"} { putcmdlog "$FL #$hand# FLHelp part" putdcc $idx "$FL \#\#\# part <#channel>" putdcc $idx "$FL Forces a bot to leave a channel." return 0 } if {[string tolower $args] == "modes"} { putcmdlog "$FL #$hand# FLHelp modes" putdcc $idx "$FL \#\#\# modes" putdcc $idx "$FL Lets you auto set channel modes." putdcc $idx "$FL Current modes are t,n,i,p,s,m,l,k,v" putdcc $idx "$FL Example: ${CC}+v lamest, ${CC}+k private, +t" return 0 } if {[string tolower $args] == "flagnote"} { putcmdlog "$FL #$hand# FLHelp flagnote" putdcc $idx "$FL \#\#\# flagnote " putdcc $idx "$FL flagnote Sends a message to all users with a certain flag" return 0 } if {$args != ""} { dccsimul $idx ".help $args" } } ## dcc cmd FLHelp -- stop ## dcc cmd wi -- start proc dcc_wi {hand idx arg} { global botnick if {$arg == ""} { putdcc $idx "\002\[EchiEgg\]\002 Usage: whois " return 0 } dccsimul $idx ".whois $arg" } ## dcc cmd wi -- stop ## public cmd massunban -- start proc pub_massunban {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putserv "MODE $chan +b" } ## public cmd massunban -- stop ## dcc cmd mub -- start proc dcc_mub {hand idx args} { set channel [lindex $args 0] if {[validchan $channel]} { putserv "MODE $channel +b" } else { putdcc $idx "\002\[EchiEgg\]\002 Usage: mub <#channel>" } } ## dcc cmd mub -- stop ## dcc cmd massunban -- start proc dcc_massunban {hand idx args} { set channel [lindex $args 0] if {[validchan $channel]} { putserv "MODE $channel +b" } else { putdcc $idx "\002\[EchiEgg\]\002 Usage: massunban <#channel>" } } ## dcc cmd massunban -- stop ## public cmd dccstat -- start proc pub_dccstat {nick uhost hand chan rest} { set socksp " ";set usersp " ";set hostsp " " puthelp "NOTICE $nick :\002\[EchiEgg\]\002 SOCK NICK HOST TYPE" puthelp "NOTICE $nick :\002\[EchiEgg\]\002 ---- --------- ----------------- ----" foreach info [dcclist] { # set info [lsort -integer [lindex $info 0]] [lrange $info 1 end] set sock [lindex $info 0] set user [lindex $info 1] set host [lindex $info 2] set type [lindex $info 3] if {[string length $sock] < 4} { set socksize [expr [string length $socksp]-[string length $sock]] set newsocksp [string range $socksp 0 [expr $socksize - 1]] set sock "${sock}${newsocksp}" } if {[string length $user] < 9} { set usersize [expr [string length $usersp]-[string length $user]] set newusersp [string range $usersp 0 [expr $usersize - 1]] set user "${user}${newusersp}" } if {[string length $user] > 9} {set user [string range $user 0 8} if {[string length $host] < 17} { set hostsize [expr [string length $hostsp]-[string length $host]] set newhostsp [string range $hostsp 0 [expr $hostsize - 1]] set host "${host}${newhostsp}" } if {[string length $host] > 17} { set hostsize [expr [string length $host] -17] set host [string range $host $hostsize end] } if {$type == "TELNET"} {set type "lstn"} set type [string range [string tolower $type] 0 3] puthelp "NOTICE $nick :\002\[EchiEgg\]\002 $sock $user $host $type" putcmdlog "\002\[HanikEgg\]\002 #$hand# dccstat" } } ## public cmd dccstat -- stop ## public cmd -chrec -- start proc pub_-chrec {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 -chrec is only available via dcc chat." } ## public cmd -chrec -- stop ## public cmd +chrec -- start proc pub_+chrec {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 +chrec is only available via dcc chat." } ## public cmd +chrec -- stop ## public cmd debug -- start proc pub_debug {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 debug is only available via dcc chat." } ## public cmd debug -- stop ## public cmd dump -- start proc pub_dump {nick uhost hand chan rest} { if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putserv "$rest" puthelp "NOTICE $nick :Dumped Information to Server" putcmdlog "#$hand# dump $rest" } ## public cmd dump -- stop ## public cmd unloadmodule -- start proc pub_unloadmodule {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 unloadmodule is only available via dcc chat." } ## public cmd unloadmodule -- stop ## public cmd loadmodule -- start proc pub_loadmodule {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 loadmodule is only available via dcc chat." } ## public cmd loadmodule -- stop ## public cmd modules -- start proc pub_modules {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 modules is only available via dcc chat." } ## public cmd modules -- stop ## public cmd simul -- start proc pub_simul {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 simul is only available via dcc chat." } ## public cmd simul -- stop ## public cmd botattr -- start proc pub_botattr {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set chan [lindex $rest 2] set bot [lindex $rest 0] set bflags [lindex $rest 1] if {($bot == "") || ($bflags == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}botattr \[channel\]" return 0 } if {[validuser $bot] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such bot!" return 0 } if {[matchattr $bot b] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot is not a bot" return 0 } if {$chan != ""} { if {[validchan $chan]} { putcmdlog "\002\[HanikEgg\]\002 #$hand# botattr $bot $bflags $chan" if {[string trim $bflags abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-] == "|"} { botattr $bot $bflags $chan } else { botattr $bot |$bflags $chan } set chanflags [chattr $bot | $chan] set chanflags [string trimleft "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-"] set chanflags [string trim $chanflags "|"] set globalflags [chattr $ownern] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 botattr $bot \002\[\002${bflags}\002\]\002 $chan" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $bot are \002\[\002${globalflags}\002\]\002" if {$chanflags != "-"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $bot are \002\[\002${chanflags}\002\]\002" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot does not have any channel specific flags." } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" } } else { putcmdlog "\002\[HanikEgg\]\002 #$hand# botattr $bot $bflags" botattr $bot $bflags set bflags [getuser $bot BOTFL] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 botattr $bot \002\[\002${bflags}\002\]\002" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $bot are now \002\[\002${bflags}\002\]\002" } } ## public cmd -chan -- stop proc pub_-chan {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set channel [lindex $rest 0] if {$channel == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+chan <#channel>" return 0 } if {[string first # $channel]!=0} { set channel "#$channel" } if {[validchan $channel]} { putcmdlog "\002\[HanikEgg\]\002 #$hand# -chan $channel" channel remove $channel puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel $channel removed from the bot." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 This includes any channel specific bans you set." } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 That channel doesnt exist!" } } ## public cmd -chan -- stop ## public cmd +chan -- start proc pub_+chan {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set channel [lindex $rest 0] set options [lindex $rest 1] if {$channel == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+chan <#channel> \[option-list\]" return 0 } if {[validchan $channel]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your already in $channel" } else { if {[string first # $channel]!=0} { set channel "#$channel" } putcmdlog "\002\[HanikEgg\]\002 #$hand# +chan $channel $options" channel add $channel $options } } ## public cmd +chan -- stop ## public cmd binds -- start proc pub_binds {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 binds is only available via dcc chat." } ## public cmd binds -- stop ## public cmd reset -- start proc pub_reset {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 reset is only available via dcc chat." } ## public cmd reset -- stop ## public cmd banner -- start proc pub_banner {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 banner is only available via dcc chat." } ## public cmd banner -- stop ## public cmd resetbans -- start proc pub_resetbans {nick uhost hand channel rest} { global CC botnick set chan $rest if {$chan != ""} { if {[validchan $chan]} { foreach ban [banlist $chan] { pushmode $chan +b [lindex $ban 0] } putserv "MODE $chan +b" putcmdlog "\002\[HanikEgg\]\002 #$hand# (${chan}) resetbans" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Resetting bans on $chan..." return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is an invalid channel." return 0 } } if {$chan == ""} { foreach ban [banlist] { foreach i [channels] { pushmode $i +b [lindex $ban 0] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Resetting bans on $i" } } foreach x [channels] { putserv "MODE $x +b" } putcmdlog "\002\[HanikEgg\]\002 #$hand# resetbans" } } ## public cmd resetbans -- stop ## public cmd flush -- start proc pub_flush {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 flush is only available via dcc chat." } ## public cmd flush -- stop ## public cmd set -- start proc pub_set {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 set is only available via dcc chat." } ## public cmd set -- stop ## public cmd chanload -- start proc pub_chanload {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putcmdlog "\002\[HanikEgg\]\002 #$hand# chanload" loadchannels puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Reloading all dynamic channel settings." } ## public cmd chanload -- stop ## public cmd chansave -- start proc pub_chansave {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putcmdlog "\002\[HanikEgg\]\002 #$hand# chansave" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Saving all dynamic channel settings." savechannels puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing channel file ..." } ## public cmd chansave -- stop ## public cmd chanset -- start proc pub_chanset {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set channel [lindex $rest 0] set options [lindex $rest 1] if {($channel == "") || ($options == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chanset # " return 0 } if {[validchan $channel]} { putcmdlog "\002\[EchiEgg\]\002 #$hand# chanset $channel $options" channel set $channel $options puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Successfully set modes \{ $options \} on $channel" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Changes to $channel are not permanent." } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such channel." } } ## public cmd chanset -- stop ## pubic cmd restart -- start proc pub_restart {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } utimer 1 restart putcmdlog "#${hand}# restart" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing user file... Writing channel file ... Restarting ..." } ## public cmd restart -- stop ## pubic cmd rehash -- start proc pub_rehash {nick uhost hand chan rest} { if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } utimer 1 rehash putcmdlog "#${hand}# rehash" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing user & channel file... Rehashing.. Userfile loaded, unpacking..." } ## public cmd rehash -- stop ## public cmd relay -- start proc pub_relay {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 relay is only available via dcc chat." } ## public cmd relay -- stop ## public cmd chaninfo -- start proc pub_chaninfo {nick uhost hand chan rest} { global CC if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chaninfo <#channel>" return 0 } if {[validchan $rest]} { set em [lindex [channel info $rest] 0] putcmdlog "\002\[EchiEgg\]\002 #$hand# chaninfo $rest" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Settings for static channel $rest" set em [lindex [channel info $rest] 0] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Protect modes (chanmode): $em" if {[lindex [channel info $rest] 1] == "0"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Idle Kick after (idle-kick): DONT!" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Idle Kick after (idle-kick): [lindex [channel info $rest] 1] min" } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Other modes:" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 [lindex [channel info $rest] 12] [lindex [channel info $rest] 13] [lindex [channel info $rest] 14] [lindex [channel info $rest] 15]" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 [lindex [channel info $rest] 16] [lindex [channel info $rest] 17] [lindex [channel info $rest] 18] [lindex [channel info $rest] 19]" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 [lindex [channel info $rest] 20] [lindex [channel info $rest] 21] [lindex [channel info $rest] 22] [lindex [channel info $rest] 23]" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 [lindex [channel info $rest] 24] [lindex [channel info $rest] 25] [lindex [channel info $rest] 26]" set ichan [lindex [channel info $rest] 7] set ictcp [lindex [channel info $rest] 8] set ijoin [lindex [channel info $rest] 9] set ikick [lindex [channel info $rest] 10] set ideop [lindex [channel info $rest] 11] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 flood settings: chan: $ichan ctcp: $ictcp join: $ijoin kick: $ikick deop: $ideop" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such channel defined." } } ## public cmd chaninfo -- stop ## public cmd status -- start proc pub_status {nick uhost hand chan rest} { global botnick CC server max-file-users max-filesize admin chanmode version uptime timezone files-path incoming-path putcmdlog "\002\[HanikEgg\]\002 #$hand# status" set vers [lindex $version 0] set users [countusers] regsub -all " " [channels] ", " chans puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am $botnick, running eggdrop v${vers}: $users users" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Running on [exec uname -sr]" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Server $server" set totalyear [expr [unixtime] - $uptime] if {$totalyear >= 31536000} { set yearsfull [expr $totalyear/31536000] set years [expr int($yearsfull)] set yearssub [expr 31536000*$years] set totalday [expr $totalyear - $yearssub] } if {$totalyear < 31536000} { set totalday $totalyear set years 0 } if {$totalday >= 86400} { set daysfull [expr $totalday/86400] set days [expr int($daysfull)] set dayssub [expr 86400*$days] set totalhour [expr $totalday - $dayssub] } if {$totalday < 86400} { set totalhour $totalday set days 0 } if {$totalhour >= 3600} { set hoursfull [expr $totalhour/3600] set hours [expr int($hoursfull)] set hourssub [expr 3600*$hours] set totalmin [expr $totalhour - $hourssub] } if {$totalhour < 3600} { set totalmin $totalhour set hours 0 } if {$totalmin >= 60} { set minsfull [expr $totalmin/60] set mins [expr int($minsfull)] } if {$totalmin < 60} { set mins 0 } if {$years < 1} {set yearstext ""} elseif {$years == 1} {set yearstext "$years year, "} {set yearstext "$years years, "} if {$days < 1} {set daystext ""} elseif {$days == 1} {set daystext "$days day, "} {set daystext "$days days, "} if {$hours < 1} {set hourstext ""} elseif {$hours == 1} {set hourstext "$hours hour, "} {set hourstext "$hours hours, "} if {$mins < 1} {set minstext ""} elseif {$mins == 1} {set minstext "$mins minute"} {set minstext "$mins minutes"} if {[string length $mins] == 1} {set mins "0${mins}"} if {[string length $hours] == 1} {set hours "0${hours}"} set output "${yearstext}${daystext}${hours}:${mins}" set output [string trimright $output ", "] set cpu [lindex [exec ps ux [exec cat pid.${botnick}]] 13] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Online for $output (background) CPU $cpu" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Admin: $admin" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 DCC file path: ${files-path}" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 incoming: ${incoming-path}" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 max users is ${max-file-users}" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 DCC max file size: ${max-filesize}k" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channels: $chans" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Server $server" foreach x [channels] { set ch [llength [chanlist $x]] set em [lindex [channel info $x] 0] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $x : $ch members, enforcing \"${em}\"" } } ## public cmd status -- stop ## public cmd boot -- start proc pub_boot {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Access denied, people should know who is booting them." } ## public cmd boot -- stop ## public cmd assoc -- start proc pub_assoc {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 assoc is only available via dcc chat." } ## public cmd assoc -- stop ## public cmd chbotattr -- start proc pub_chbotattr {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 See botattr command." } ## public cmd chbotattr -- stop ## public cmd unlink -- start proc pub_unlink {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}unlink " return 0 } if {([validuser $rest] == 0) || ([matchattr $rest b] == 0)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not in my userlist as a bot." return 0 } if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] == -1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not linked on the botnet." return 0 } if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] > -1} { putcmdlog "\002\[EchiEgg\]\002 #$hand# unlink $rest" unlink $rest puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Breaking link with $rest" } } ## public cmd unlink -- stop ## public cmd link -- start proc pub_link {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}link " return 0 } if {([validuser $rest] == 0) || ([matchattr $rest b] == 0)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not in my userlist as a bot." return 0 } if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] > -1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already linked on the botnet." return 0 } if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] == -1} { putcmdlog "\002\[HanikEgg\]\002 #$hand# link $rest" link $rest puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Linking to $rest at [getaddr $rest]" } } ## public cmd link -- end ## public cmd su -- start proc pub_su {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 su is only available via dcc chat." } ## public cmd strip -- start proc pub_strip {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 strip is only available via dcc chat." } ## public cmd strip -- stop ## public cmd page -- start proc pub_page {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 page is only available via dcc chat." } ## public cmd page -- stop ## public cmd filestats -- start proc pub_filestats {nick uhost hand chan rest} { global CC if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}filestats " return 0 } if {[validuser $rest] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not in my userlist." return 0 } if {[validuser $rest] == 1} { set uploads [getuploads $rest] set nul [lindex [getuploads $rest] 0] set tul [lindex [getuploads $rest] 1] set ndl [lindex [getdnloads $rest] 0] set tdl [lindex [getdnloads $rest] 1] putcmdlog "\002\[HanikEgg\]\002 #$hand# filestats $rest" if {$tul >9} {set main " "} else {set main " "} if {$tul >99} {set main " "} else {set main " "} if {$tdl >9} {set main " "} else {set main " "} if {$tdl >99} {set main " "} else {set main " "} if {$nul >9} {set s " "} else {set s " "} if {$nul >99} {set s " "} else {set s " "} if {$nul >999} {set s " "} else {set s " "} if {$nul >9999} {set s " "} else {set s " "} if {$ndl >9} {set s " "} else {set s " "} if {$ndl >99} {set s " "} else {set s " "} if {$ndl >999} {set s " "} else {set s " "} if {$ndl >9999} {set s " "} else {set s " "} puthelp "NOTICE $nick :\002\[HanikEgg\]\002 \037${rest}'s filestats\037" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 uploads:${main}${nul} /${s}${tul}k" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 downloads:${main}${ndl} /${s}${tdl}k" } } ## public cmd filestats -- stop ## public cmd unstick -- start proc pub_unstick {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 unstick is only available via dcc chat." } ## public cmd unstick -- stop ## public cmd stick -- start proc pub_stick {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 stick is only available via dcc chat." } ## public cmd stick -- stop ## public cmd fixcodes -- start proc pub_fixcodes {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 fixcodes is only available via dcc chat." } ## public cmd fixcodes -- stop ## public cmd trace -- start proc pub_trace {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 trace is only available via dcc chat." } ## public cmd trace -- stop ## public cmd botinfo -- start proc pub_botinfo {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[EchiEgg\]\002 botinfo is only available via dcc chat." } ## public cmd botinfo -- stop ## public cmd chaddr -- start proc pub_chaddr {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 This command requires you to authenticate. /msg $botnick auth " return 0 } set botname [lindex $rest 0] set changes [lindex $rest 1] if {($botname == "") || ($changes == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chaddr " return 0 } set porttest [string trim $changes "abcdefghijklmnopqrstuvwxyx."] set porttest [string trim $porttest ":"] if {$porttest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chaddr " return 0 } if {[validuser $botname] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 There is no such bot in the userlist." return 0 } if {[matchattr $botname b] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is not a bot." return 0 } botattr $botname $changes set oldaddy [getuser $botname BOTADDR] set oldaddy [lindex $oldaddy 0]:[lindex $oldaddy 1]/[lindex $oldaddy 2] puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Changed ${botname}'s Address from \002\[\002${oldaddy}\002\]\002 to \002\[\002$changes\002\]\002" } ## public cmd chaddr -- stop ## public cmd rollcall -- start proc pub_rollcall {nick uhost hand chan rest} { global CC botnick version set botvers [lindex $version 0] set cmdchar $CC putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! rollcall" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am ${botnick}, running eggdrop v${botvers}" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 My Command Charactor is \002\[\002${CC}\002\]\002" } ## public cmd rollcall -- stop ## dcc cmd access -- start proc dcc_access {hand idx rest} { global CC set who [lindex $rest 0] set chan [lindex $rest 1] if {$who == ""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: .access " return 0 } if {$who == "me"} { if {$chan != ""} { if {[validchan $chan]} { set swho $hand set cflags [chattr $swho | $chan] set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set cfflags [string trim $nflags "|"] putlog "\002\[EchiEgg\]\002 !$hand! access $swho $chan" if {$cfflags == "-"} { putdcc $idx "\002\[HanikEgg\]\002 You do not have any channel specific flags on ${chan}." return 0 } else { putdcc $idx "\002\[HanikEgg\]\002 Your access is \002\[\002${cfflags}\002\]\002 on ${chan}." return 0 } } else { putdcc $idx "\002\[HanikEgg\]\002 $chan is not a valid channel." return 0 } } if {$chan == ""} { set mwho $hand set mflags [chattr $mwho] putlog "\002\[FL\]\002 !$hand! access $mwho" putdcc $idx "\002\[HanikEgg\]\002 Your access is \002\[\002${mflags}\002\]\002" return 0 } } if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { set cflags [chattr $who | $chan] set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set cfflags [string trim $nflags "|"] putlog "\002\[HanikEgg\]\002 !$hand! access $who $chan" if {$cfflags == "-"} { putdcc $idx "\002\[HanikEgg\]\002 You do not have any channel specific flags on ${chan}." return 0 } else { putdcc $idx "\002\[HanikEgg\]\002 ${who}'s access is \002\[\002${cfflags}\002\]\002 on ${chan}." return 0 } } else { putdcc $idx "\002\[HanikEgg\]\002 $chan is not a valid channel." return 0 } } if {$chan == ""} { set flags [chattr $who] putlog "\002\[HanikEgg\]\002 !$hand! access $who" putdcc $idx "\002\[HanikEgg\]\002 ${who}'s access is \002\[\002${flags}\002\]\002" return 0 } } if {[validuser $who] == 0} { putdcc $idx "\002\[HanikEgg\]\002 No such user!" return 0 } } ## dcc cmd access -- stop ## public cmd access -- start proc pub_access {nick uhost hand chan rest} { global CC set who [lindex $rest 0] set chan [lindex $rest 1] if {$who == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}access " return 0 } if {$who == "me"} { if {$chan != ""} { if {[validchan $chan]} { set swho $hand set cflags [chattr $swho | $chan] set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set cfflags [string trim $nflags "|"] putlog "\002\[EchiEgg\]\002 !$hand! access $swho $chan" if {$cfflags == "-"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You do not have any channel specific flags on ${chan}." return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your access is \002\[\002${cfflags}\002\]\002 on ${chan}." return 0 } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel." return 0 } } if {$chan == ""} { set mwho $hand set mflags [chattr $mwho] putlog "\002\[FL\]\002 !$hand! access $mwho" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your access is \002\[\002${mflags}\002\]\002" return 0 } } if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { set cflags [chattr $who | $chan] set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set cfflags [string trim $nflags "|"] putlog "\002\[EchiEgg\]\002 !$hand! access $who $chan" if {$cfflags == "-"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 ${who} does not have any channel specific flags on ${chan}." return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 ${who}'s access is \002\[\002${cfflags}\002\]\002 on ${chan}." return 0 } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel." return 0 } } if {$chan == ""} { set flags [chattr $who] putlog "\002\[EchiEgg\]\002 !$hand! access $who" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 ${who}'s access is \002\[\002${flags}\002\]\002" return 0 } } if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user!" return 0 } } ## public cmd access -- stop ## public cmd botnick -- start proc pub_botnick {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set bot [lindex $rest 0] if {$bot==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 ${CC}botnick ." return 0 } putcmdlog "\002\[HanikEgg\]\002 #$hand# botnick $bot" putserv "NICK $bot" } ## public cmd botnick -- stop ## dcc cmd botnick -- start proc dcc_botnick {hand idx rest} { set bot [lindex $rest 0] if {$bot==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 .botnick ." return 0 } putcmdlog "\002\[HanikEgg\]\002 #$hand# botnick $bot" putserv "NICK $bot" } ## dcc cmd botnick -- stop ## public cmd jump -- start proc pub_jump {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set server [lindex $rest 0] if {$server == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: jump \[port\] \[password\]" return 0 } set port [lindex $rest 1] if {$port == ""} {set port "6667"} set password [lindex $rest 2] putcmdlog "\002\[HanikEgg\]\002 #$hand# jump $server $port $password" jump $server $port $password } ## public cmd jump -- stop ## public cmd die -- start proc pub_die {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set idx [hand2idx $nick] if {$rest == ""} {set rest "No given reason"} save putcmdlog "\002\[HanikEgg\]\002 #$hand# quit $rest" if {$rest == ""} {set rest "Requested"} foreach x [userlist] { chattr $x -Q } putserv "QUIT :\002${rest}\002" utimer 2 {die} } ## public cmd die -- stop ## public cmd reload -- start proc pub_reload {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } reload putcmdlog "\002\[EchiEgg\]\002 #$hand# reload" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Reloading user file..." } ## public cmd restart -- stop ## public cmd ignores -- start proc pub_ignores {nick uhost hand chan rest} { global CC botnick set iglist "" foreach x [ignorelist] { set iglister [lindex $x 0] set iglist "$iglist $iglister" } if {[ignorelist]==""} { putserv "NOTICE $nick :No ignores." return 0 } regsub -all " " $iglist ", " iglist set iglist [string range $iglist 1 end] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Currently ignoring:$iglist" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! ignores" return 0 } ## public cmd ignores -- stop ## public cmd -ignore -- start proc pub_-ignore {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set hostmask [lindex $rest 0] if {$hostmask == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-ignore " return 0 } if {[isignore $hostmask] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $hostmask is not on my ignore list." return 0 } if {[isignore $hostmask] == 1} { putcmdlog "\002\[HanikEgg\]\002 #$hand# -ignore $hostmask" killignore $hostmask puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No longer ignoring \002\[\002${hostmask}\002\]\002" save } } ## public cmd -ignore -- stop ## public cmd +ignore -- start proc pub_+ignore {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set hostmask [lindex $rest 0] set comment [lindex $rest 1] if {$hostmask == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+ignore \[comment\]" return 0 } if {[isignore $hostmask] == 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $hostmask is alreay set on ignore." return 0 } if {[isignore $hostmask] == 0} { putcmdlog "\002\[HanikEgg\]\002 #$hand# +ignore $hostmask" newignore $hostmask $nick $comment 0 puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Now ignoring \002\[\002${hostmask}\002\]\002" save } } ## public cmd +ignore -- stop ## public cmd comment -- start proc pub_comment {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set comment [lrange $rest 0 end] if {($comment == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}comment " return 0 } putcmdlog "\002\[HanikEgg\]\002 #$hand# comment $comment" setuser $hand comment $comment puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added comment \002\[\002${comment}\002\]\002" } ## public cmd comment -- stop ## public cmd chnick -- start proc pub_chnick {nick uhost hand chan rest} { global CC owner botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set old [lindex $rest 0] set new [lindex $rest 1] if {($old == "") || ($new == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chnick " return 0 } if {[validuser $old]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {([matchattr $old n] == 1)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 cannot change the bot owner's nick" return 0 } if {[validuser $old]==1} { putcmdlog "\002\[HanikEgg\]\002 #$hand# chnick $old $new" chnick $old $new puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Changed partyline nick from \002\[\002${old}\002\]\002 to \002\[\002${new}\002\]\002" } } ## public cmd chnick -- stop ## public cmd chinfo -- start proc pub_chinfo {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set info [lrange $rest 1 end] if {($who == "") || ($info == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chinfo " return 0 } if {[validuser $who]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {[validuser $who]==1} { putcmdlog "\002\[EchiEgg\]\002 #$hand# chinfo $who $info" setuser $who info $info puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added info \002\[\002${info}\002\]\002 to $who." } } ## public cmd chinfo -- stop ## public cmd chcomment -- start proc pub_chcomment {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 This command requires you to authenticate yourself. Please /msg $botn$ return 0 } set who [lindex $rest 0] set comment [lrange $rest 1 end] if {($who == "") || ($comment == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chcomment " return 0 } if {[validuser $who]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {[validuser $who]==1} { putcmdlog "\002\[EchiEgg\]\002 #$hand# chcomment $who $comment" setuser $who comment $comment puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added info \002\[\002${comment}\002\]\002 to $who." } } ## public cmd chcomment -- stop ## public cmd chemail -- start proc pub_chemail {nick uhost hand chan rest} { global CC botnick # puthelp "NOTICE $nick :\002\[HanikEgg\]\002 This command is only available via dcc chat" # return 0 if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set email [lindex $rest 1] if {($who == "") || ($email == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chemail " return 0 } if {[validuser $who]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {[validuser $who]==1} { putcmdlog "\002\[HanikEgg\]\002 #$hand# chemail $who $email" setuser $who email $email puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added email address \002\[\002${email}\002\]\002 to $who." } } ## public cmd chemail -- stop ## public cmd chpass -- start proc pub_chpass {nick chan uhost hand rest} { global CC puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Can only be changed via dcc chat." } ## public cmd chpass -- stop ## public cmd me -- start proc pub_me {nick uhost hand channel rest} { global CC if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage ${CC}me " return 0 } putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! me $rest" putserv "PRIVMSG $channel :\001ACTION $rest\001" } ## public cmd me -- stop ## public cmd save -- start proc pub_save {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putcmdlog "\002\[EchiEgg\]\002 #$hand# save" save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing channel & user file ..." } ## public cmd save -- stop ## public cmd chattr -- start proc pub_chattr {nick uhost hand channel rest} { global ownern flagss lowerflag nflagl CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set ownern [lindex $rest 0] set flagss [lindex $rest 1] set chan [lindex $rest 2] if {$ownern==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chattr " return 0 } if {[validuser $ownern]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user!" return 0 } if {$flagss==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}chattr " return 0 } if {([matchattr $ownern n] == 1) && ([matchattr $nick n] == 0)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You do not have access to change ${ownern}'s flags." } if {[matchattr $nick n] == 1} { if {$chan != ""} { if {[validchan $chan]} { putcmdlog "\002\[EchiEgg\]\002 #$hand# chattr $ownern $flagss $chan" if {[string trim $flagss abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-] == "|"} { chattr $ownern $flagss $chan } else { chattr $ownern |$flagss $chan } set chanflags [chattr $ownern | $chan] set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set chanflags [string trim $chanflags "|"] set globalflags [chattr $ownern] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 chattr $ownern \002\[\002${flagss}\002\]\002 $chan" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $ownern are \002\[\002${globalflags}\002\]\002" if {$chanflags != "-"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $ownern are \002\[\002${chanflags}\002\]\002" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $ownern does not have any channel specific flags on ${chan}." } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" } } else { putcmdlog "\002\[HanikEgg\]\002 #$hand# chattr $ownern $flagss $chan" chattr $ownern $flagss set flags [chattr $ownern] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $ownern are now \002\[\002${flags}\002\]\002" } if {[matchattr $ownern a] == 1} { pushmode $channel +o $ownern } if {([matchattr $ownern a] == 0) && ([matchattr $ownern o] == 0)} { pushmode $channel -o $ownern } save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing user file ..." } ##stop them from adding/removing +n if their not a owner. if {[matchattr $nick n] == 0} { set lowerflag [string tolower $flagss] set nflagl [string trim $flagss abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-] if {$nflagl != ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You do not have access to add or remove the flag \002'\002n\002'\002 from that user." return 0 } } ##stops other users from giving others +m. if {([matchattr $nick n] == 0) && ([matchattr $nick m] == 1) && ([matchattr $ownern m] == 1)} { set lowerflag [string tolower $flagss] set nflagl [string trim $flagss abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-] if {$nflagl != ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You do not have access to add or remove the flag \002'\002m\002'\002 from $ownern." return 0 } } if {([matchattr $nick n] == 0) && ([matchattr $ownern n] == 0)} { if {$chan != ""} { if {[validchan $chan]} { putcmdlog "\002\[HanikEgg\]\002 #$hand# chattr $ownern $flagss" if {[string trim $flagss abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-] == "|"} { chattr $ownern $flagss $chan } else { chattr $ownern |$flagss $chan } set chanflags [chattr $ownern | $chan] set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set chanflags [string trim $chanflags "|"] set globalflags [chattr $ownern] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002 $chan" puthelp "NOTICE $nick :\002\[vEgg\]\002 Global Flags for $ownern are \002\[\002${globalflags}\002\]\002" if {$chanflags != "-"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $ownern are \002\[\002${chanflags}\002\]\002" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $ownern does not have any channel specific flags on ${chan}." } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" return 0 } } else { putcmdlog "\002\[HanikEgg\]\002 #$hand# chattr $ownern $flagss" chattr $ownern $flagss set flags [chattr $ownern] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $ownern are now \002\[\002${flags}\002\]\002" } if {[matchattr $ownern a] == 1} { pushmode $channel +o $ownern } save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing user file ..." } } ## public cmd chattr -- stop ## public cmd -host -- start proc pub_-host {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set hostname [lindex $rest 1] set completed 0 if {($who == "") || ($hostname == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-host " return 0 } if {[validuser $who]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {([matchattr $nick n] == 0) && ([matchattr $who n] == 1)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Can't remove hostmasks from the bot owner." return 0 } if {[matchattr $nick m] == 0} { if {[string tolower $hand] != [string tolower $who]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You need '+m' to change other users hostmasks" return 0 } } foreach * [getuser $who HOSTS] { if {${hostname} == ${*}} { putcmdlog "\002\[HanikEgg\]\002 #$hand# -host $who $hostname" delhost $who $hostname save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Removed \002\[\002${hostname}\002\]\002 from $who." ### Make it do the -host thing here, and any message that goes along with it set completed 1 } } if {$completed == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such hostmask!" } } ## public cmd -host -- stop ## public cmd +host -- start set thehosts { *@* * *!*@* *!* *!@* !*@* *!*@*.* *!@*.* !*@*.* *@*.* *!*@*.com *!*@*com *!*@*.net *!*@*net *!*@*.org *!*@*org *!*@*gov *!*@*.ca *!*@*ca *!*@*.uk *!*@*uk *!*@*.mil *!*@*.fr *!*@*fr *!*@*.au *!*@*au *!*@*.nl *!*@*nl *!*@*edu *!*@*se *!*@*.se *!*@*.nz *!*@*nz *!*@*.eg *!*@*eg *!*@*dk *!*@*.il *!*@*il *!*@*.no *!*@*no *!*@*br *!*@*.br *!*@*.gi *!*@*.gov *!*@*.dk *!*@*.edu *!*@*gi *!*@*mil *!*@*.to *!@*.to *!*@*to *@*.to *@*to } proc pub_+host {nick uhost hand chan rest} { global CC thehosts botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set hostname [lindex $rest 1] if {($who == "") || ($hostname == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+host " return 0 } if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user!" return 0 } set badhost 0 foreach * [getuser $who HOSTS] { if {${hostname} == ${*}} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 That hostmask is already there." return 0 } } if {($who == "") && ($hostname == "")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+host " return 0 } if {([lsearch -exact $thehosts $hostname] > "-1") || ([string match *@* $hostname] == 0)} { if {[string index $hostname 0] != "*"} { set hostname "*!*@*${hostname}" } else { set hostname "*!*@${hostname}" } } if {([string match *@* $hostname] == 1) && ([string match *!* $hostname] == 0)} { if {[string index $hostname 0] == "*"} { set hostname "*!${hostname}" } else { set hostname "*!*${hostname}" } } puthelp "NOTICE kindred :$hostname" if {[validuser $who]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such user." return 0 } if {([matchattr $nick n] == 0) && ([matchattr $who n] == 1)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Can't add hostmasks to the bot owner." return 0 } foreach * $thehosts { if {${hostname} == ${*}} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Invalid hostmask!" set badhost 1 } } if {$badhost != 1} { if {[matchattr $nick m] == 0} { if {[string tolower $hand] != [string tolower $who]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You need '+m' to change other users hostmasks" return 0 } } putcmdlog "\002\[EchiEgg\]\002 #$hand# +host $who $hostname" setuser $who HOSTS $hostname puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added \002\[\002${hostname}\002\]\002 to $who." if {[matchattr $who a] == 1} { pushmode $chan +o $who } save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Writing user file ..." } } ## public cmd +host -- stop ## public cmd -bot -- start proc pub_-bot {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set bot [lindex $rest 0] if {$bot==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-bot " return 0 } if {[validuser $bot] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot is not on my userlist." return 0 } if {[matchattr $bot b] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot is not a bot on the userlist." return 0 } if {[matchattr $bot b] == 1} { putcmdlog "\002\[HanikEgg\]\002 #$hand# -bot $bot" deluser $bot puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot has been deleted from the userlist." save } } ## public cmd -bot -- stop ## public cmd +bot -- start proc pub_+bot {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set bot [lindex $rest 0] set address [lindex $rest 1] set hostmask [lindex $rest 2] if {[validuser $bot]==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot is already in my userlist." return 0 } if {($bot=="") || ($address=="")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+bot \[hostmask\]" return 0 } set porttest [string trim $address "abcdefghijklmnopqrstuvwxyx."] set porttest [string trim $porttest ":"] if {$porttest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+bot \[hostmask\]" return 0 } if {[validuser $bot]==0} { putcmdlog "\002\[HanikEgg\]\002 #$hand# +bot $bot $address $hostmask" addbot $bot $address if {$hostmask != ""} { setuser $bot HOSTS $hostmask } save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $bot \002\[\002${address}\002\]\002 has been add to userlist as a bot." return 0 } } ## public cmd +bot -- stop ## public cmd deluser -- start proc pub_deluser {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}deluser " return 0 } else { pub_-user $nick $uhost $hand $channel $rest} { } } ## public cmd deluser -- stop ## public cmd -user -- start proc pub_-user {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] if {$who == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}-user " } else { if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is not on my userlist." } else { if {[matchattr $who n] == 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You cannot delete a bot owner." } else { if {([matchattr $who m] == 1) && ([matchattr $nick n] == 0)} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You don't have access to delete $who." } else { putcmdlog "\002\[EchiEgg\]\002 #$hand# -user $who" deluser $who save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who has been deleted." } } } } } ## public cmd -user -- stop ## public cmd +user -- start proc pub_+user {nick uhost hand channel rest} { global CC botnick thehosts if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set hostmask [lindex $rest 1] if {([lsearch -exact $thehosts $hostmask] > "-1") || ([string match *@* $hostmask] == 0)} { if {[string index $hostmask 0] != "*"} { set hostmask "*!*@*${hostmask}" } else { set hostmask "*!*@${hostmask}" } } if {([string match *@* $hostmask] == 1) && ([string match *!* $hostmask] == 0)} { if {[string index $hostmask 0] == "*"} { set hostmask "*!${hostmask}" } else { set hostmask "*!*${hostmask}" } } if {$hostmask == ""} { if {[onchan $who $channel] == 1} { regsub -all " " [split [maskhost [getchanhost mark- #wonkegg]] !] "!*" hostmask } } if {[validuser $who]==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is already in my userlist." return 0 } if {($who=="") || ($hostmask=="")} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+user " return 0 } set who [lindex $rest 0] set flags [lindex $rest 2] if {[validuser $who]==0} { putcmdlog "\002\[HanikEgg\]\002 #$hand# +user $who $hostmask" adduser $who $hostmask save puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who has been added to userlist with hostmask \002\[\002$hostmask\002\]\002." if {$flags != ""} { chattr $who $flags $channel puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Added $flags to $who" } return 0 } } ## public cmd +user -- stop ## public cmd adduser -- start proc pub_adduser {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[lindex $rest 0] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}adduser \[optional flags\]" return 0 } if {[validuser [lindex $rest 0]]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already in my userlist." return 0 } if {[onchan [lindex $rest 0] $channel]==1} { set who [lindex $rest 0] set oflags [lindex $rest 1] set host [maskhost [getchanhost [lindex $rest 0] $channel]] putcmdlog "\002\[EchiEgg\]\002 #$hand# adduser $who $oflags" adduser $who $host if {$oflags != ""} { if {[lindex $rest 2] != ""} { chattr $who |${oflags} [lindex $rest 2] set flags [chattr $who] set newhost [getuser $who HOSTS] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who \002\[\002$newhost\002\]\002 has been added to the userlist." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002" set chanflags [chattr [lindex $rest 0] | [lindex $rest 2]] set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set chanflags [string trim $chanflags |] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel \002\"\002[lindex $rest 2]\002\"\002 Flags for $who are \002\[\002${chanflags}\002\]\002" save return 0 } else { chattr $who $oflags set flags [chattr $who] set newhost [getuser $who HOSTS] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who \002\[\002$newhost\002\]\002 has been added to the userlist." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002" save return 0 } } else { set flags [chattr $who] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who \002\[\002$host\002\]\002 has been added to the userlist." puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002" save return 0 } } if {[onchan [lindex $rest 0] $channel]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 That user is not on $channel." } } ## public cmd adduser -- stop ## dcc cmd action -- start proc cmd_action {idx text} { set text [string trim $text \001] set text [lrange $text 1 end] dccsimul $idx ".me $text" return 1 } ## dcc cmd action -- stop ## public cmd part -- start proc pub_part {nick uhost hand chan rest} { set rest [lindex $rest 0] global nopart botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[v\]\002 Auth First" return 0 } if {[string first # $rest]!=0} { set rest "#$rest" } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: part <#channel>" return 0 } else { foreach x [channels] { if {[string tolower $x]==[string tolower $rest]} { if {[string tolower $rest]==[string tolower $nopart]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Sorry I can not part $nopart \[PROTECTED\]" return 0 } channel remove $rest puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I have left $x" putcmdlog "\002\[EchiEgg\]\002 #$hand# part $x" return 0 } } } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I wasn't in $rest" } ## public cmd part -- stop ## public cmd join -- start proc pub_join {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set chan [lindex $rest 0] if {[string first # $chan]!=0} { set chan "#$chan" } if {$chan=="#"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}join <#channel>" } else { foreach x [channels] { if {[string tolower $x]==[string tolower $chan]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your already in $x" return 0 } } if {[lindex $rest 1] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I have joined $chan" } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I have joined $chan (key: [lindex $rest1])" } channel add $chan if {$rest!=""} { putserv "JOIN $chan :[lindex $rest 1]" putcmdlog "\002\[HanikEgg\]\002 #$hand# join $chan (key: [lindex $rest1])" } } } ## public cmd join -- stop ## dcc cmd join -- start proc cmd_join {hand idx rest} { set chan [lindex $rest 0] if {[string first # $chan]!=0} { set chan "#$chan" } if {$chan=="#"} { putdcc $idx "\002\[HanikEgg\]\002 Usage: join <#channel> \[key\]" } else { foreach x [channels] { if {[string tolower $x]==[string tolower $chan]} { putdcc $idx "\002\[HanikEgg\]\002 Your already in $x" return 0 } } if {[lindex $rest 1] == ""} { putdcc $idx "\002\[HanikEgg\]\002 I have joined $chan" } else { putdcc $idx "\002\[HanikEgg\]\002 I have joined $chan (key: [lindex $rest 1])" } channel add $chan if {$rest!=""} { putserv "JOIN $chan :[lindex $rest 1]" putcmdlog "\002\[HanikEgg\]\002 #$hand# join $chan (key: [lindex $rest 1])" } } } ## dcc cmd join -- stop ## dcc cmd part -- start proc cmd_part {hand idx rest} { set rest [lindex $rest 0] global nopart if {[string first # $rest]!=0} { set rest "#$rest" } if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: part <#channel>" return 0 } else { foreach x [channels] { if {[string tolower $x]==[string tolower $rest]} { if {[string tolower $rest]==[string tolower $nopart]} { putdcc $idx "\002\[HanikEgg\]\002 Sorry I can not part $nopart \[PROTECTED\]" return 0 } channel remove $rest putdcc $idx "\002\[HanikEgg\]\002 I have left $x" putcmdlog "\002\[HanikEgg\]\002 #$hand# part $x" return 0 } } } putdcc $idx "\002\[HanikEgg\]\002 I wasn't in $rest" } ## dcc cmd part -- stop ## public cmd channels -- start proc pub_channels {nick hand uhost chan rest} { regsub -all " " [channels] ", " chans puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channels: $chans" } ## public cmd channels -- stop ## dcc cmd say -- start proc cmd_say {hand idx rest} { if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: say " } if {$rest!=""} { set chan2send [lindex [console $idx] 0] puthelp "PRIVMSG $chan2send :$rest" putcmdlog "\002\[HanikEgg\]\002 #$hand# say $rest" } } ## dcc cmd say -- stop ## dcc cmd act -- start proc cmd_act {hand idx rest} { if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: act " } if {$rest!=""} { set chan2send [lindex [console $idx] 0] putserv "PRIVMSG $chan2send :\001ACTION $rest\001" putcmdlog "\002\[HanikEgg\]\002 #$hand# act $rest" } } ## dcc cmd act -- stop ## dcc cmd addlog -- start proc cmd_addlog {hand idx rest} { if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: addlog " } else { putcmdlog "\002\[HanikEgg\]\002 $hand: $rest" } } ## dcc cmd addlog -- stop ## dcc cmd invite -- start proc cmd_invite {hand idx rest} { set rest [lindex $rest 0] set activechan [lindex [console $idx] 0] if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: invite " return 0 } else { if {[onchan $rest $activechan]==1} { putdcc $idx "\002\[HanikEgg\]\002 $rest is on $activechan already!" return 0 } else { putserv "INVITE $rest :$activechan" putdcc $idx "\002\[HanikEgg\]\002 Invitation sent to $rest" putcmdlog "\002\[HanikEgg\]\002 #$hand# invite $rest" } } } ## public cmd invite -- stop ## cmd aop join -- start proc aop_join {nick hand uhost channel} { global botnick if {[botisop $channel]==0} { foreach x $channel { if {[string tolower $channel]==[string tolower $x]} { pushmode $channel +o $nick } } } if {[botisop $channel]!=0} { if {$botnick!=$nick} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I would have auto oped you... but I am not oped" } } } ## cmd aop join -- stop ## dcc cmd raop -- start proc cmd_raop {hand idx rest} { set who [lindex $rest 0] set chan [lindex $rest 1] if {$who != ""} { if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { if {[matchattr $who |a $chan] == 1} { chattr $who |-a $chan puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is no longer auto oped on $chan" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! raop $who $chan" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who wasn't auto oped on $chan" return 0 } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" return 0 } } else { if {[matchattr $who a] == 1} { chattr $who -a puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is no longer a global auto oped" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! raop $who $chan" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who wasn't auto oped" return 0 } } } if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is not a valid user" } } if {$who == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: raop " } } ## dcc cmd raop -- stop ## public cmd raop -- start proc pub_raop {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set chan [lindex $rest 1] if {$who != ""} { if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { if {[matchattr $who |a $chan] == 1} { chattr $who |-a $chan puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is no longer auto oped on $chan" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! raop $who $chan" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who wasn't auto oped on $chan" return 0 } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" return 0 } } else { if {[matchattr $who a] == 1} { chattr $who -a puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is no longer a global auto oped" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! raop $who $chan" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who wasn't auto oped" return 0 } } } if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is not a valid user" } } if {$who == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: raop " } } ## public cmd raop -- start ## public cmd aop -- start proc pub_aop {nick uhost hand channel rest} { global botnick CC if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set who [lindex $rest 0] set chan [lindex $rest 1] if {$who != ""} { if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { if {[matchattr $who |a $chan] == 0} { chattr $who |a $chan puthelp "NOTICE $nick :\002\[EchiEgg\]\002 $who is now auto oped on $chan" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! aop $who $chan" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is already auto oped on $chan" return 0 } } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $chan is not a valid channel" return 0 } } else { if {[matchattr $who a] == 0} { chattr $who +a puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is now global auto oped." putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! aop $who" return 0 } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is already auto oped" return 0 } } } if {[validuser $who] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $who is not a valid user" } } if {$who == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}aop " } } ## public cmd aop -- stop ## dcc cmd aop -- start proc cmd_aop {hand idx rest} { set who [lindex $rest 0] set chan [lindex $rest 1] if {$who != ""} { if {[validuser $who] == 1} { if {$chan != ""} { if {[validchan $chan]} { if {[matchattr $who |a $chan] == 0} { chattr $who |a $chan putdcc $idx "\002\[HanikEgg\]\002 $who is now auto oped on $chan" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! aop $who $chan" return 0 } else { putdcc $idx "\002\[HanikEgg\]\002 $who is already auto oped on $chan" return 0 } } else { putdcc $idx "\002\[HanikEgg\]\002 $chan is not a valid channel" return 0 } } else { if {[matchattr $who a] == 0} { chattr $who +a putdcc $idx "\002\[HanikEgg\]\002 $who is now global auto oped." putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! aop $who" return 0 } else { putdcc $idx "\002\[HanikEgg\]\002 $who is already auto oped" return 0 } } } if {[validuser $who] == 0} { putdcc $idx "\002\[HanikEgg\]\002 $who is not a valid user" } } if {$who == ""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: aop " } } ## dcc cmd aop -- stop ## public cmd channel -- start proc pub_channel {nick uhost hand channel rest} { global botnick set rest [lindex $rest 0] set chanlisting "" foreach x [chanlist $channel] { set dathand [nick2hand $x $channel] if {$dathand=="*"} {set dathand "?"} set chanlisting "$chanlisting $x\[$dathand\]" } puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Channel:$chanlisting" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! channel" } ## public cmd channel -- stop ## public cmd who -- start proc pub_who {nick uhost hand channel rest} { global botnick set peoplelist "" set botlist "" set e " " foreach x [dcclist] { set people [lindex $x 1] set type [lindex $x 3] set bot [lindex $x 1] if {$type == "CHAT"} { string trim $people " " set peoplelist "$peoplelist $people" set peoplenum $e\[[llength $peoplelist]\] } if {$type == "BOT"} { string trim $bot " " set botlist "$botlist $bot" set botnum $e\[[llength $bot]\] } } if {[string trim ${peoplelist} " "]==""} { set peoplelist " No one is on $botnick" set peoplenum "" } if {[string trim ${botlist} ""]==""} { set botlist " No bots are linked to $botnick" set botnum "" } regsub -all " " $peoplelist ", " peoplelist regsub -all " " $botlist ", " botlist set peoplelist [string range $peoplelist 1 end] set botlist [string range $botlist 1 end] puthelp "NOTICE $nick :\002\[HanikEgg\]\002 People$peoplenum:$peoplelist" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Bots$botnum:$botlist" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! who" return 0 } ## public cmd who -- stop proc pub_wi {nick uhost hand channel rest} { global botnick max-notes pub_whois $nick $uhost $hand $channel $rest } proc pub_whois {nick uhost hand channel rest} { global botnick max-notes set fl "\002\[FL\]\002" if {[validuser $rest] == 0} { putserv "NOTICE $nick :\002\[HanikEgg\]\002 No such user!" return 0 } set user [lindex $rest 0] set ch [passwdok "$rest" ""] if {!$ch} {set pass "yes"} else {set pass "no "} set notes [notes $user] set flags [chattr $user] while {[string length $flags] < 15} { append flags " " } while {[string length $user] < 9} { append user " " } if {[string length $notes] == "1"} {set notes " ${notes}"} if {[string length $notes] == "2"} {set notes " ${notes}"} #set flags [chattr $user] #set userlen [string length $user] #set bl1 " " #if {$userlen < 9} { # set dt1 [expr 8-$userlen] # set add [string range $bl1 0 $dt1] # append user $add #} #if {$userlen > 9} {set user [string range $userlen 0 8]} #set flagslen [string length $flags] #set bl2 " " #if {$flagslen < 15} { # set dt2 [expr 14-$flagslen] # set add [string range $bl2 0 $dt2] # append flags $add #} set lastseen [ctime [lindex [getuser [string trim $user] LASTON] 0]] set day "[lindex $lastseen 0]." set month "[lindex $lastseen 1], [lindex $lastseen 2]" set time [lindex $lastseen 3] set year "[string range [lindex $lastseen 4] 2 3]" set last "$time on $month" #if {$flagslen > 15} {set flags [string range $flagslen 0 14]} puthelp "NOTICE $nick :$fl HANDLE PASS NOTES FLAGS LAST" puthelp "NOTICE $nick :$fl $user $pass $notes $flags $last" set user [string trim $user] if {![matchattr $user b]} { foreach i [channels] { set tchan [string length $i] set bl3 " " if {$tchan < 18} { set dt3 [expr 17-$tchan] set add2 [string range $bl3 0 $dt3] append chans $i$add2 } set cflags [chattr $user | $i] set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] set cfflags [string trim $nflags "|"] set cf [string length $cfflags] set flagslen2 [string length $cf] set bl26 " " if {$flagslen2 < 14} { set dt26 [expr 13-$flagslen2] set add4 [string range $bl26 0 $dt26] append flags12 $add4 } if {$flagslen2 > 14} {set flags12 [string range $flagslen2 0 13]} set lastseen2 [ctime [lindex [getuser $user LASTON $i] 0]] set day2 "[lindex $lastseen2 0]." set month2 "[lindex $lastseen2 1], [lindex $lastseen2 2]" set time2 [lindex $lastseen2 3] set year2 "`[string range [lindex $lastseen2 4] 2 3]" set last2 "$time on $month2" puthelp "NOTICE $nick :$fl $chans $cfflags $flags12 $last2" } } if {[getuser $user HOSTS] != ""} { set hosts [getuser $user hosts] puthelp "NOTICE $nick :$fl HOSTS: $hosts" } if {[getuser $user BOTFL] != ""} { puthelp "NOTICE $nick :$fl BOT FLAGS: [getuser $user BOTFL]" } if {[getuser $user BOTADDR] != ""} { set botinfo [getuser $user BOTADDR] puthelp "NOTICE $nick :$fl ADDRESS: [lindex $botinfo 0]" puthelp "NOTICE $nick :$fl telnet: [lindex $botinfo 1], relay: [lindex $botinfo 2]" } } ## public cmd whois -- stop ## public cmd whom -- start proc pub_whom {nick uhost hand channel rest} { set peoplelist "" foreach x [whom 0] { set people [lindex $x 0] string trim $people " " set peoplelist "$peoplelist ${people}@[lindex [string trim $x ""] 1]" } regsub -all " " $peoplelist ", " peoplelist set peoplelist [string range $peoplelist 1 end] if {[string trim ${peoplelist} " "]==""} { set peoplelist " No one is on the partyline" } puthelp "NOTICE $nick :\002\[EchiEgg\]\002 People:$peoplelist" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! whom" return 0 } ## public cmd whom -- stop ## public cmd match -- start proc pub_match {nick uhost hand chan rest} { global CC if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}match " return 0 } set rest [string trim $rest +] if {[string length $rest] > 1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Invalid option." return 0 } if {$rest!=""} { set rest "+[lindex $rest 0]" if {[userlist $rest]!=""} { regsub -all " " [userlist $rest] ", " users puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Match \[$rest\]: $users" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! match $rest" return 0 } if {[userlist $rest]==""} { puthelp "NOTICE $nick :\002\[EchiEgg\]\002 No users with flags \[$rest\]" return 0 } } } ## public cmd match -- stop ## dcc cmd match -- start proc dcc_match {hand idx args} { set flags [lindex $args 0] set flags [string trim $flags +] if {$flags==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: match " return 0 } if {[string length $flags] > 1} { putdcc $idx "\002\[HanikEgg\]\002 Invalid Option." return 0 } if {$flags!=""} { if {[userlist $flags]!=""} { regsub -all " " [userlist $flags] ", " users putdcc $idx "\002\[EchiEgg\]\002 Match \[$flags\]: $users" putlog "\002\[HanikEgg\]\002 #$hand# match $flags" return 0 } if {[userlist $flags]==""} { putdcc $idx "\002\[HanikEgg\]\002 No users with flags \[$flags\]" return 0 } } } ## dcc cmd match -- stop ## public cmd bots -- start proc pub_bots {nick uhost hand chan rest} { if {[bots]==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No bots connected" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! bots" return 0 } if {[bots]!=""} { regsub -all " " [bots] ", " bots puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Bots: $bots" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! bots" return 0 } } ## public cmd bots -- stop ## public cmd bottree -- start proc pub_bottree {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Bottree is only available via dcc chat, try Bots" } ## public cmd bottree - stop ## public cmd notes -- start proc pub_notes {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 notes is only available via dcc chat" } ## public cmd notes -- stop proc val {string} { set arg [string trim $string /ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz] set arg2 [string trim $arg #!%()@-_+=\[\]|,.?<>{}] return $arg2 } ## public cmd +ban -- start proc pub_+ban {nick uhost hand channel rest} { global botnick CC ban-time if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel]==0} { if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}+ban \[reason\]" return 0 } if {$rest!=""} { set host [lindex $rest 0] set reason [lrange $rest 1 end] if {[string tolower $host] == [string tolower $botnick]} { putserv "KICK $channel $nick :\002\[HanikEgg\]\002 You really shouldn't try that..." return 0 } if {$reason == ""} { set reason "\002requested\002" } set options [lindex $reason 0] if {[string index $options 0] == "-"} { set options [string range $options 1 end] } switch -exact $options { perm { set reason [lrange $reason 1 end] newban $host $nick "$reason" 0 if {$reason == ""} {set reason "No reason given"} putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } min { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [lindex $reason 1] set reason [lrange $reason 2 end] newban $host $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } hours { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [lindex $reason 1]*60] set reason [lrange $reason 2 end] newban $host $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } days { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [expr [lindex $reason 1]*60]*24] set reason [lrange $reason 2 end] newban $host $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } weeks { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [expr [expr [lindex $reason 1]*60]*24]*7] set reason [lrange $reason 2 end] newban $host $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } } set reason [lrange $reason 1 end] newban $host $nick "$reason" $ban-time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! +ban $reason" return 0 } } if {[botisop $channel]!=0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped" } } ## public cmd +ban -- stop ## public cmd -ban -- start proc pub_-ban {nick uhost hand channel rest} { set rest [lindex $rest 0] global botnick botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel]==0} { if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: -ban " } if {$rest!=""} { set mbantester [catch {expr $rest-1}] if {$mbantester==1} { puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Usage: -ban " return 0 } if {[lindex [banlist $channel] [expr ${rest}-1]]==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No such channel ban. It may be a global ban" return 0 } if {[lindex [banlist $channel] [expr ${rest}-1]]!=""} { set restban [lindex [lindex [banlist $channel] 0] [expr ${rest}-1]] killchanban $channel $rest puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Ban $restban was removed" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! -ban $rest" return 0 } } } if {[isop $botnick $channel]!=1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped" } } ## public cmd -ban -- stop ## public cmd bans -- start proc pub_bans {nick uhost hand chan rest} { global CC ban-time set rest [lindex $rest 0] set rest [string toupper $rest] if {$rest!="CHANNEL"} { if {$rest!="GLOBAL"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: bans " } } set banlistchan "" if {$rest=="CHANNEL"} { foreach x [banlist $chan] { set banlister [lindex $x 0] set banlistchan "$banlistchan $banlister" } if {[banlist $chan]==""} { set banlistchan " No channel bans in $chan" } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Channel Bans:$banlistchan" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! bans channel" return 0 } set banlist "" if {$rest=="GLOBAL"} { foreach x [banlist] { set banlisting [lindex $x 0] set banlist "$banlist $banlisting" } if {$banlist==""} { set banlist " No global bans" } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Global Bans:$banlist" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! bans global" return 0 } } ## public cmd bans -- stop ## dcc cmd op -- start proc cmd_op {hand idx rest} { set rest [lindex $rest 0] set channel [lindex [console $idx] 0] global botnick if {[botisop $channel]==0} { if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: op " } if {[onchan $rest $channel]=="1"} { if {[isop $rest $channel]=="1"} { putdcc $idx "\002\[HanikEgg\]\002 $rest is already oped" } } if {$rest!=""} { if {[onchan $rest $channel]=="0"} { putdcc $idx "\002\[HanikEgg\]\002 $rest isn't on the channel" } } if {[onchan $rest $channel]=="1"} { if {[isop $rest $channel]=="0"} { pushmode $channel +o $rest putlog "\002\[HanikEgg\]\002 #$hand# op $rest" } } } if {[botisop $channel]!=0} { putdcc $idx "\002\[HanikEgg\]\002 I am not oped, sorry." } } ## dcc cmd op -- stop ## public cmd op -- start proc pub_op {nick uhost hand channel rest} { set rest [lindex $rest 0] global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel]==0} { if {$rest==""} { if {![botisop $channel]} { putserv "NOTICE $nick :Sorry, Im not op'd." return 0 } if {[isop $nick $channel]} { putserv "NOTICE $nick :You are already op'd." return 0 } putcmdlog "#$hand# op $nick" pushmode $channel +o $nick return 0 } if {[onchan $rest $channel]==1} { if {[isop $rest $channel]==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already oped." } } if {$rest!=""} { if {[onchan $rest $channel]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest isn't on the channel." } } if {[onchan $rest $channel]==1} { if {[isop $rest $channel]==0} { pushmode $channel +o $rest putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! op $rest" } } } if {[botisop $channel]!=0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped, sorry." } } ## public cmd op -- stop ## dcc cmd deop -- start proc cmd_deop {hand idx rest} { global botnick set rest [lindex $rest 0] set channel [lindex [console $idx] 0] if {[botisop $channel]==0} { if {$rest==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: deop " } if {$rest!=""} { if {[onchan $rest $channel]=="0"} { putdcc $idx "\002\[HanikEgg\]\002 $rest isn't on the channel" } } if {[onchan $rest $channel]=="1"} { if {[isop $rest $channel]=="0"} { putdcc $idx "\002\[HanikEgg\]\002 $rest is already deoped" } } if {[string tolower $botnick] == [string tolower $rest]} { putdcc $idx "\002\[HanikEgg\]\002 I don't deop myself..." } if {[isop $rest $channel]=="1"} { if {[onchan $rest $channel]=="1"} { if {$botnick!=$rest} { pushmode $channel -o $rest putlog "\002\[HanikEgg\]\002 #$hand# deop $rest" } } } } if {[botisop $channel]!=0} { putdcc $idx "\002\[HanikEgg\]\002 I am not oped" } } ## dcc cmd deop -- stop ## public cmd deop -- start proc pub_deop {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set rest [lindex $rest 0] if {[botisop $channel]==0} { if {$rest==""} { if {![botisop $channel]} { putserv "NOTICE $nick :Sorry, Im not op'd." return 0 } if {![isop $nick $channel]} { putserv "NOTICE $nick :You are already deop'd." return 0 } putcmdlog "#$hand# deop $nick" pushmode $channel -o $nick return 0 } if {$rest!=""} { if {[onchan $rest $channel] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest isn't on the channel." return 0 } } if {[onchan $rest $channel]=="1"} { if {[isop $rest $channel]=="0"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already deoped." return 0 } } if {[string tolower $botnick] == [string tolower $rest]} { putserv "KICK $channel $nick :I don't deop myself..." return 0 } if {[isop $rest $channel]=="1"} { if {[onchan $rest $channel]=="1"} { if {[string tolower $botnick] != [string tolower $rest]} { pushmode $channel -o $rest putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! deop $rest" } } } } if {[botisop $channel]!=0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped, sorry." } } ## public cmd deop -- stop ## public cmd topic -- start proc pub_topic {nick uhost hand channel rest} { global botnick topicnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest!=""} { if {[botisop $channel]==0} { if {$topicnick == 0} { putserv "TOPIC $channel :$rest" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! topic $rest" } else { putserv "TOPIC $channel :$rest (${hand})" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! topic $rest" } } if {[botisop $channel]!=0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped" } } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: topic " } } ## public cmd topic -- stop ## public cmd act -- start proc pub_act {nick uhost hand channel rest} { if {$rest!=""} { putserv "PRIVMSG $channel :\001ACTION $rest\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! act $rest" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Usage: act " } } ## public cmd act -- stop ## public cmd say -- start proc pub_say {nick uhost hand channel rest} { if {$rest!=""} { puthelp "PRIVMSG $channel :$rest" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! say $rest" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: say " } } ## public cmd say -- stop ## public cmd msg -- start proc pub_msg {nick uhost hand channel rest} { set person [lindex $rest 0] set rest [lrange $rest 1 end] if {$rest!=""} { puthelp "PRIVMSG $person :$rest" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! msg $rest" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: msg " } } ## public cmd msg -- stop ## public cmd motd -- start proc pub_motd {nick uhost hand channel rest} { global newpath botnick version vers admin network set mfile "${newpath}alt.motd" if {![file exists $mfile]} { set new [open $mfile w] putserv "NOTICE $nick :I am $botnick, running v[lindex $version 0] with EchiEgg.tcl v${vers}" puts $new "I am $botnick, running v[lindex $version 0] with EchiEgg.tcl v${vers}" putserv "NOTICE $nick :Admin: $admin" puts $new "Admin: $admin" regsub -all " " [channels] ", " chans putserv "NOTICE $nick :Located: $chans on $network" puts $new "Located: $chans on $network" close $new } else { set info [fileinfo $mfile] set info [lrange $info 0 2] foreach x $info { putserv "NOTICE $nick :$x" } } } ## public cmd motd -- stop ## public cmd addlog -- start proc pub_addlog {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: addlog " } if {$rest!=""} { putlog "\002\[HanikEgg\]\002 $hand: $rest" } } ## public cmd addlog -- stop ## public cmd invite -- start proc pub_invite {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set rest [lindex $rest 0] if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: invite " } if {$rest!=""} { if {[onchan $rest $chan]==0} { putserv "INVITE $rest :$chan" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Invitation to $chan has been sent to $rest" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! invite $rest" return 0 } if {[onchan $rest $chan]==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $rest is already on the channel" } } } ## public cmd invite -- stop ## public cmd nick -- start proc pub_nick {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set rest [lindex $rest 0] if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: nick " } if {$rest!=""} { chnick $hand $rest puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your partyline handle is now [nick2hand $nick $chan]" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! nick $rest" return 0 } } ## public cmd nick -- stop ## public cmd away -- start proc pub_away {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest!=""} { putserv "AWAY :$rest" putserv "PRIVMSG $channel :\001ACTION is now marked as away: $rest\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! away $rest" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: away " } } ## public cmd away -- stop ## public cmd back -- start proc pub_back {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } putserv "AWAY :" putserv "PRIVMSG $channel :\001ACTION is back...\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! back" return 0 } ## public cmd back -- stop ## public cmd chat -- start proc pub_chat {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Chat is only available via dcc chat" } ## public cmd chat -- stop ## public cmd note -- start proc pub_note {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set reciever [lindex $rest 0] set rest [lrange $rest 1 end] if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: note " } if {$rest!=""} { set notetest [sendnote $hand $reciever $rest] if {$notetest==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Note to $reciever was recieved" } if {$notetest==2} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Note to $reciever was stored \[local\]" } if {$notetest==3} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 ${reciever}'s mailbox was full" } if {$notetest==4} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Tcl binding intercepted the note" } if {$notetest==5} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $reciever was away, note stored" } if {$notetest==0} { puthelp "NOTICE $nick :Send to $reciever failed" return 0 } putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! note $reciever *masked*" } } ## public cmd chat -- stop ## public cmd files -- start proc pub_files {nick uhost hand chan rest} { global botnick global sizeoffile set wowfiles [getfiles /] set wowdirs [getdirs /] if {$wowfiles!=""} { set z 0 puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $botnick is offering \002[llength $wowfiles] packs\002, type \002.get \[X\]\002 to recieve a file" foreach x $wowfiles { set z [expr $z+1] set sizeoffile [string trim [exec du dcc/$x] dcc/$x] if {[expr $sizeoffile/1024]!=0} { set sizeofthefile \[[expr $sizeoffile/1024]MB\] while {[string length $sizeofthefile]<7} { set sizeofthefile " $sizeofthefile" } } if {[expr $sizeoffile/1024]==0} { set sizeofthefile \[${sizeoffile}k\] while {[string length $sizeofthefile]<8} { set sizeofthefile " $sizeofthefile" } } set wowfiles "\002${sizeofthefile}\002 $x" if {$z<10} { set z " $z" } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $z\002)\002 $wowfiles" } } if {$wowfiles==""} {set wowfiles "No files available"} if {$wowdirs==""} {set wowdirs "No directories available"} if {$wowfiles=="No files available"} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Files: $wowfiles" } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Directories: $wowdirs" puthelp "NOTICE $nick :\002\[v\]\002 Many more commands available via dcc chat" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! files" return 0 } ## public cmd files -- stop ## public cmd newpass -- start proc pub_newpass {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Newpass: For some reason, I think not" } ## public cmd newpass -- stop ## public cmd console -- start proc pub_console {nick uhost hand chan rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Console is only available via dcc chat" } ## public cmd console -- stop ## public cmd servers -- start proc pub_servers {nick uhost hand chan rest} { global server puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Server: Current Server is $server" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! servers" return 0 } ## public cmd servers -- stop ## publuc cmd quit -- strt proc pub_quit {nick uhost hand channel rest} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 quit is only available via dcc chat." } ## public cmd quit -- stop ## public cmd k -- start proc pub_k {nick uhost hand channel rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}k \[reason\]" } if {$rest!=""} { pub_kick $nick $uhost $hand $channel $rest } } ## public cmd k -- stop ## public cmd kick -- start proc pub_kick {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel]==0} { if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: kick \[reason\]" return 0 } set handle [lindex $rest 0] set reason [lrange $rest 1 end] if {![onchan $handle $channel]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $handle is not on the channel!" return 0 } if {[onchansplit $handle $channel]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $handle is currently net-split." return 0 } if {$reason == ""} { set reason "requested" } if {[string tolower $handle] == [string tolower $botnick]} { putserv "KICK $channel $nick :That was not Smart!" return 0 } else { if {[matchattr $handle n] == 1} { putserv "KICK $channel $nick :Don't kick the boss..." return 0 } else { putserv "KICK $channel $handle :\002${reason}\002" if {$reason == ""} {set reason "No given reason"} putcmdlog "\002\[HanikEgg\]\002 #$hand# kick $handle $reason" return 0 } } } if {[botisop $channel]==0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped" } } ## dcc cmd kick -- stop ## public cmd mdeop -- start proc cmd_mdeop {hand idx arg} { global botnick set args [lindex $arg 0] if {$args == ""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: mdeop <#channel>" } if {$args != ""} { dcc_massdeop $hand $idx $arg } } ## public cmd mdeop -- stop ## public cmd mop -- start proc cmd_mop {hand idx arg} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set args [lindex $arg 0] if {$args == ""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: mop <#channel>" } if {$args != ""} { dcc_massop $hand $idx $arg } } ## public cmd mop -- stop ## public cmd massdeop -- start proc pub_massdeop {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set deopnicks "" set mass 1 if {$mass==1} { set deopnicks "" set massdeop 0 set members [chanlist $chan] foreach x $members { if {([isop $x $chan] == 1) && ([onchansplit $x $chan] == 0) && ($x != $botnick) && ($x != $hand)} { if {$massdeop < 6} { append deopnicks " $x" set massdeop [expr $massdeop + 1] } if {$massdeop == 6} { set massdeop 0 putserv "MODE $chan -oooooo $deopnicks" set deopnicks "" append deopnicks " $x" set massdeop 1 } } } putserv "MODE $chan -oooooo $deopnicks" putlog "\002\[HanikEgg\]\002 #$hand# massdeop" } } ## public cmd massdeop -- stop ## public cmd massop -- start proc pub_massop {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set deopnicks "" set mass 1 if {$mass == 1} { set opnicks "" set massops 0 set members [chanlist $chan] foreach x $members { if {([isop $x $chan] == 0) && ([onchansplit $x $chan] == 0) && ($x != $botnick)} { if {$massops < 6} { append opnicks " $x" set massops [expr $massops + 1] } if {$massops == 6} { set massops 0 pushmode $chan +oooooo $opnicks set opnicks "" append opnicks " $x" set massops 1 } } } pushmode $chan +oooooo $opnicks putlog "\002\[HanikEgg\]\002 #$hand# massop" } } ## public cmd massop -- stop ## dcc cmd massdeop -- start proc dcc_massdeop {hand idx arg} { global botnick set deopnicks "" set mass 1 set chan [lindex $arg 0] if {$chan == ""} { putdcc $idx "\002\[\HanikEgg\]\002 Usage: massdeop <#channel>" return 1 } if {$mass==1} { set deopnicks "" set massdeop 0 set members [chanlist $chan] foreach x $members { if {([isop $x $chan] == 1) && ([onchansplit $x $chan] == 0) && ($x != $botnick) && ($x != $hand)} { if {$massdeop < 6} { append deopnicks " $x" set massdeop [expr $massdeop + 1] } if {$massdeop == 6} { set massdeop 0 putserv "MODE $chan -oooooo $deopnicks" set deopnicks "" append deopnicks " $x" set massdeop 1 } } } putserv "MODE $chan -oooooo $deopnicks" putlog "\002\[HanikEgg\]\002 #$hand# massdeop" } } ## dcc cmd massdeop -- stop ## dcc cmd massop -- start proc dcc_massop {hand idx arg} { global botnick set deopnicks "" set mass 1 set chan [lindex $arg 0] if {$chan == ""} { putdcc $idx "\002\[\HanikEgg\]\002 Usage: massop <#channel>" return 1 } if {$mass == 1} { set opnicks "" set massops 0 set members [chanlist $chan] foreach x $members { if {([isop $x $chan] == 0) && ([onchansplit $x $chan] == 0) && ($x != $botnick)} { if {$massops < 6} { append opnicks " $x" set massops [expr $massops + 1] } if {$massops == 6} { set massops 0 pushmode $chan +oooooo $opnicks set opnicks "" append opnicks " $x" set massops 1 } } } pushmode $chan +oooooo $opnicks putlog "\002\[HanikEgg\]\002 #$hand# massop" } } ## dcc cmd massop -- stop ## public cmd kb -- start proc pub_kb {nick uhost hand channel rest} { global botnick CC if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel]==0} { if {$rest == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: ${CC}kb \[reason\]" return 0 } if {$rest!=""} { set handle [lindex $rest 0] set reason [lrange $rest 1 end] append userhost $handle "!*" [getchanhost $handle $channel] set hostmask [maskhost $userhost] if {![onchan $handle $channel]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $handle is not on the channel." return 0 } if {[onchansplit $handle $channel]} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 $handle is currently net-split." return 0 } if {[string tolower $handle] == [string tolower $botnick]} { putserv "KICK $channel $nick :\002\[HanikEgg\]\002 You really shouldn't try that..." return 0 } if {$reason == ""} { set reason "requested" } set options [lindex $reason 0] if {[string index $options 0] == "-"} { set options [string range $options 1 end] } switch -exact $options { perm { set reason [lrange $reason 1 end] newchanban $channel $hostmask $nick "$reason" 0 if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } min { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [lindex $reason 1] set reason [lrange $reason 2 end] newchanban $channel $hostmask $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } hours { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [lindex $reason 1]*60] set reason [lrange $reason 2 end] newchanban $channel $hostmask $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } days { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [expr [lindex $reason 1]*60]*24] set reason [lrange $reason 2 end] newchanban $channel $hostmask $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } weeks { if {[val [lindex $reason 1]] == ""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Error, invalid time period" return 0 } set time [expr [expr [expr [lindex $reason 1]*60]*24]*7] set reason [lrange $reason 2 end] newchanban $channel $hostmask $nick "$reason" $time if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } } set reason [lrange $reason 1 end] newchanban $channel $hostmask $nick "$reason" 0 if {$reason == ""} {set reason "No reason given"} putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason" putserv "KICK $channel $handle :$reason" return 0 } } if {[isop $botnick $channel]!=1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 I am not oped" } } ## public cmd ban -- stop ## public cmd info -- start proc pub_info {nick uhost hand chan rest} { global botnick # puthelp "NOTICE $nick :\002\[HanikEgg\]\002 This command is only available via dcc chat" # return 0 if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {$rest==""} { set wowthatinfo [getuser $hand INFO] if {$wowthatinfo==""} {set wowthatinfo "No info is set"} puthelp "NOTICE $nick :\002\[EchiEgg\]\002 Info: $wowthatinfo" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! info" return 0 } if {$rest!=""} { if {[string toupper $rest]=="NONE"} { setuser $hand info "" puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your info has been cleared" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! info none" return 0 } if {[string toupper $rest]!="NONE"} { setuser $hand info $rest puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Your info is now $rest" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! info $rest" return 0 } } } ## public cmd info -- stop ## public cmd get -- start proc pub_get {nick uhost hand chan rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } set rest [lindex $rest 0] if {$rest==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: get " } if {$rest!=""} { set f 0 if {[catch {set numberoffile [expr $rest-1]}]==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: get " return 0 } foreach x [getfiles /] { if {$x==[lrange [getfiles /] $numberoffile $numberoffile]} { set f 1 } } if {$f==1} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Sending you [lrange [getfiles /] $numberoffile $numberoffile]" dccsend dcc/[lrange [getfiles /] $numberoffile $numberoffile] $nick putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! get $rest" return 0 } if {$f!="1"} { puhelp "NOTICE $nick :\002\[HanikEgg\]\002 Incorrect file number" } } } ## public cmd get -- stop ## dcc cmd userlist -- start proc cmd_userlist {hand idx args} { set args [lindex $args 0] set f [lindex $args 0] if {[userlist $f] ==""} { putdcc $idx "\002\[HanikEgg\]\002 No users with flag(s) $f." putcmdlog "\002\[HanikEgg\]\002 #$hand# userlist $f" return 0 } if {[userlist $f] !=""} { regsub -all " " [userlist $f] ", " userlist putdcc $idx "\002\[HanikEgg\]\002 Userlist: $userlist" putcmdlog "\002\[HanikEgg\]\002 #$hand# userlist $f" return 0 } } ## dcc cmd userlist -- stop ## public cmd userlist -- start proc pub_userlist {nick uhost hand chan rest} { set rest [lindex $rest 0] set f [lindex $rest 0] if {[userlist $f] ==""} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 No users with flag(s) \[$f\]" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! userlist $f" } if {[userlist $f] !=""} { set tester $f if {$tester!=""} {set tester " \[$tester\]"} regsub -all " " [userlist $f] ", " userlist puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Userlist$tester: $userlist" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! userlist $f" } } ## public cmd userlist -- stop ## dcc cmd ramen -- start proc cmd_ramen {hand idx args} { global botnick set cmd [string tolower [lindex $args 0]] putdcc $idx "* $botnick makes you some good ass ramen noodles" putdcc $idx "Enjoy!" putcmdlog "\002\[HanikEgg\]\002 #$hand# ramen" return 0 } ## dcc cmd ramen -- stop ## public cmd pez -- start proc pub_pez {nick uhost hand chan rest} { global botnick set cmd [string tolower [lindex $rest 0]] puthelp "PRIVMSG $chan :\001ACTION rips open a pack of pez for $nick\001" puthelp "PRIVMSG $chan :ENJOY!" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! pez" return 0 } ## public cmd ramen -- start proc pub_ramen {nick uhost hand chan rest} { global botnick set cmd [string tolower [lindex $rest 0]] puthelp "PRIVMSG $chan :\001ACTION makes $nick some good ass ramen noodles.\001" puthelp "PRIVMSG $chan :ENJOY!" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! ramen" return 0 } ## public cmd ramen -- stop ## public cmd ping -- start proc pub_ping {nick uhost hand chan rest} { global botnick set cmd [string tolower [lindex $rest 0]] puthelp "PRIVMSG $chan :${nick}, \002muach... sayang\002" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! ping" } ## public cmd ping -- stop ## public cmd pong -- start proc pub_pong {nick uhost hand chan rest} { global botnick set cmd [string tolower [lindex $rest 0]] puthelp "PRIVMSG $chan :${nick}, \002muach... sayang\002" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! pong" } ## public cmd pong -- stop ## dcc cmd channels -- start proc cmd_channels {hand idx args} { putdcc $idx "\002\[HanikEgg\]\002 Channels: [channels]" putcmdlog "\002\[HanikEgg\]\002 #$hand# channels" } ## dcc cmd channels --- stop ## public cmd beer -- start proc pub_beer {nick uhost hand chan rest} { global botnick set rest [string tolower [lindex $rest 0]] if {$rest==""} { puthelp "PRIVMSG $chan :\001ACTION hands $nick a frothy beer.\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer" return 0 } switch $rest { sixpack { putserv "PRIVMSG $chan :Here's some sixpacks, it's on me... =]" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } keg { putserv "PRIVMSG $chan :Hey...lets go in the woods and have a kegger!" putserv "PRIVMSG $chan :hurry up and give me one =]" putserv "PRIVMSG $chan :Damn...I can't walk....tink I am done..." putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } mug { putserv "PRIVMSG $chan :Here's your mug of beer.... " putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } can { putserv "PRIVMSG $chan :\001ACTION calls Fido\001" putserv "PRIVMSG $chan :Fido...get me a beer...thx" putserv "PRIVMSG $chan :\001ACTION hands $nick a can of beer\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } tap { putserv "PRIVMSG $chan :\001ACTION puts his head under the tap\001" putserv "PRIVMSG $chan :\001ACTION opens his mouth\001" putserv "PRIVMSG $chan :\001ACTION gets plastered\001" putserv "PRIVMSG $chan :Sorry....all gone =P" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } time { putserv "PRIVMSG $chan :Guess what time it is guys?" if {[isop $botnick $chan]==1} { putserv "TOPIC $chan :\002It's Beer Time!!"} if {[isop $botnick $chan]!=1} { putserv "PRIVMSG $chan :\002It's Beer Time!!"} putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } help { putserv "NOTICE $nick :\002\[HanikEgg\]\002 Beer Help" putserv "NOTICE $nick :\002\[HanikEgg\]\002 Usage: beer " putserv "NOTICE $nick :\002\[HanikEgg\]\002 Usable Beer Types Are:" putserv "NOTICE $nick :\002\[HanikEgg\]\002 Sixpack, Keg, Mug, Can, Tap, Time" putserv "NOTICE $nick :\002\[HanikEgg\]\002 End Of Help -" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! beer $rest" return 0 } return 0 } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: beer '" } ## public cmd beer -- stop ## public cmd drug -- start proc pub_drug {nick uhost hand chan rest} { global botnick set rest [string tolower [lindex $rest 0]] if {$rest == ""} { puthelp "PRIVMSG $chan :\001ACTION hands $nick a phat joint.\001" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug" return 0 } switch $rest { weed { putserv "PRIVMSG $chan :Here's some weed, now pack a bong =]" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } bud { putserv "PRIVMSG $chan :Beer or Weed?" putserv "PRIVMSG $chan :...ummm...here's some of both..." putserv "PRIVMSG $chan :Have a good time $nick " putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } shrooms { putserv "PRIVMSG $chan :Here's your shrooms, hope their good..." putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } acid { putserv "PRIVMSG $chan :\001ACTION grabs some sheets\001" putserv "PRIVMSG $chan :\001ACTION quickly eats one\001" putserv "PRIVMSG $chan :HeRe'S YOUr shEEt $nick =]" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } time { putserv "PRIVMSG $chan :Guess what time it is guys?" if {[isop $botnick $chan]==1} { putserv "TOPIC $chan :\002It's Time for Drugs!!" } if {[isop $botnick $chan]!=1} { putserv "PRIVMSG $chan :\002It's Time for Drugs!!" } putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } help { putserv "NOTICE $nick :\002\[HanikEgg\]\002 Drug Help" putserv "NOTICE $nick :\002\[HanikEgg\]\002 Usage: drug " putserv "NOTICE $nick :\002\[HanikEgg\]\002 Usable Drug Types Are:" putserv "NOTICE $nick :\002\[HanikEgg\]\002 Weed, Bud, Shrooms, Acid, Opium, " putserv "NOTICE $nick :\002\[HanikEgg\]\002 Extasy, Time" putserv "NOTICE $nick :\002\[HanikEgg\]\002 End Of Help -" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } opium { putserv "PRIVMSG $chan :Yummmy....$nick has good taste" putserv "PRIVMSG $chan :\001ACTION packs a bowl for $nick\001" putserv "PRIVMSG $chan :Here is OUR bowl of opium =P" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } extasy { putserv "PRIVMSG $chan :Wow....I love this shit..." putserv "PRIVMSG $chan :\001ACTION gets two pills\001" putserv "PRIVMSG $chan :\001ACTION gives $nick a pill" putserv "PRIVMSG $chan :\001ACTION eats a pill" putserv "PRIVMSG $chan :hey $nick where are the women?" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! drug $rest" return 0 } return 0 } puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Usage: drug " } ## public cmd drug -- stop ## dcc cmd global -- start proc cmd_global {hand idx args} { set gsay [lindex $args 0] global botnick if {$gsay!=""} { dccbroadcast "\002GLOBAL <${hand}@${botnick}>\002 : $gsay" putcmdlog "\002\[HanikEgg\]\002 #$hand# global $gsay" } if {$gsay==""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: global " } } ## dcc global -- stop ## dcc cmd flagnote -- start set oldflags "c d f j k m n o p x t h a v q" set botflags "a b h l r s p" proc cmd_flagnote {hand idx arg} { global oldflags botflags set whichflag [lindex $arg 0] set message [lrange $arg 1 end] if {$whichflag == "" || $message == ""} { putdcc $idx "\002\[HanikEgg\]\002 Usage: flagnote " return 0 } if {[string index $whichflag 0] == "+"} { set whichflag [string index $whichflag 1] } set normwhichflag [string tolower $whichflag] set boldwhichflag \[\002+$normwhichflag\002\] if {([lsearch -exact $botflags $normwhichflag] > 0)} { putdcc $idx "\002\[HanikEgg\]\002 The flag $boldwhichflag is for bots only" putdcc $idx "\002\[HanikEgg\]\002 Choose from the following: $oldflags $newflags" return 0 } if {([lsearch -exact $oldflags $normwhichflag] < 0) && ([lsearch -exact $botflags $normwhichflag] < 0)} { putdcc $idx "\002\[HanikEgg\]\002 The flag $boldwhichflag is not a defined flag" putdcc $idx "\002\[HanikEgg\]\002 Choose from the following: $oldflags" return 0 } putlog "\002\[HanikEgg\]\002 #$hand# flagnote [string tolower \[+$whichflag\]] ..." putdcc $idx "\002\[HanikEgg\]\002 Sending FlagNote to all $boldwhichflag users" foreach user [userlist $normwhichflag] { if {(![matchattr $user b])} { sendnote $hand $user "$whichflag $message" } } } ## dcc cmd flagnote -- stop ## public cmd time -- start proc pub_time {nick uhost hand chan rest} { global timezone set fronttime [string range [time] 0 1] set backtime [string range [time] 2 4] if {$fronttime == "00"} { puthelp "NOTICE $nick :\002\[EchiEgg\]\002 The current time is 12$backtime AM $timezone" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! time" return 0 } if {$fronttime < 12} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 The current time is $fronttime$backtime AM $timezone" putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! time" return 0 } if {$fronttime >= 12} { putserv "NOTICE $nick :\002\[HanikEgg\]\002 The current time is [expr $fronttime-12]$backtime PM $timezone" putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! time" return 0 } } ## public cmd time -- stop ## public cmd down -- start proc pub_down {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel] != 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Im not oped, sorry." return 0 } if {[isop $nick $channel] == 1} { putlog "\002\[HanikEgg\]\002 <<$nick>> !$hand! down" pushmode $channel -o $nick } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You are already deoped." return 0 } } ## public cmd down -- stop ## public cmd up -- start proc pub_up {nick uhost hand channel rest} { global botnick if {[matchattr $hand Q] == 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Auth First" return 0 } if {[botisop $channel] != 0} { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 Im not oped, sorry." return 0 } if {[isop $nick $channel] == 0} { putlog "\002\[EchiEgg\]\002 <<$nick>> !$hand! up" pushmode $channel +o $nick } else { puthelp "NOTICE $nick :\002\[HanikEgg\]\002 You are already oped." return 0 } } ## public cmd up -- stop #Remote Message by primo bind msg o kick msg_kick proc msg_kick {nick host handle arg} { if {![matchattr $nick f]} {return 0} global botnick set who [lindex $arg 0] set channel [lindex $arg 1] set why [lrange $arg 2 end] set n2hand [nick2hand $who $channel] if {![onchan $who $channel]} { putserv "NOTICE $nick : $who no such in $channel" return 1 } if {[matchattr $nick m]} { putserv "KICK $channel $who : $why" putlog "(**Command: .Kick by $nick on $who in $channel..Reason: $why**)" return 1 } if {[matchattr $who +n]} { putserv "KICK $channel $nick : Stupid !!! Don't kick My Boss !!!" return 1 } if {[string tolower $who] == [string tolower $botnick]} { putserv "KICK $channel $nick : Who r u ?? Never Play with me !!!" return 1 } if {$who == ""} { putserv "NOTICE $nick : Gunakan: /msg kick " return 1 } if {$who == $nick} { putserv "KICK $channel $nick : What Happend ???" putlog "(**Command: .kick Attempted by $nick on me, on $channel**)" return 1 } if {[matchattr $n2hand n]} { putserv "KICK $channel $nick : Stupid !!!" putlog "(**Command: .kick Attempted by nick on $who on $channel**)" return 1 } if {$why == ""} { putserv "KICK $channel $who : Requested by $nick" putserv "NOTICE $nick : Kicked $who from $channel " putlog "(**Command: .kick used by $nick to kick $who on $channel**)" return 1 } putserv "KICK $channel $who :$why" putlog "(**Command: .kick used by $nick to kick $who on $channel cause $why**)" return 1 } bind msg o|o +ban msg_+ban proc msg_+ban {nick uhost hand rest} { global botnick if {![matchattr $hand f]} {return 0} set chan [lindex $rest 0] if {$chan == "#" || $chan == ""} {putquick "NOTICE $nick :Command: /msg $botnick +ban <#channel> \[ban time (minute(s))\] \[reason\]" ; return 0} if {![string match "#*" $chan]} {set chan "#$chan"} if {![validchan $chan]} {putquick "NOTICE $nick :I am not on channel: $chan, check out my channel list." ; return 0} set rest [lrange $rest 1 end] if {$rest == ""} {putquick "NOTICE $nick :Command: /msg $botnick +ban <#channel> \[ban time (minute(s))\] \[reason\]" ; return 0} set bntime [lindex $rest 1] ; set reason [lrange $rest 2 end] set bntime [string trim $bntime "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+|~,./;'<>?:{}"] if {$bntime == ""} {set bntime 15} ; if {$reason == ""} {set reason "1Mass Message/Advertising"} set bannick [lindex $rest 0] if {[string match "*@*" $bannick]} { set host $bannick ; set banhost $host ; set banhand $host } else { if {![onchan $bannick $chan]} {putquick "NOTICE $nick : $bannick is not on channel: $chan." ; return 0 } else {set host [getchanhost $bannick $chan] ; set banhost *!*@[lindex [split $host @] 1]} set banhand [nick2hand $bannick $chan] } if {[string tolower $bannick] == [string tolower $botnick]} {putquick "NOTICE $nick : I will not ban on myself." ; return 0} if {[matchattr $banhand f]} {putquick "NOTICE $nick : I will not place ban on $bannick coz a hostmask of this user is included in my user list." ; return 0} foreach x [userlist] { if {[string match *$x* $banhost]} {putquick "NOTICE $nick : I will not place ban on $bannick coz this hostmask belongs to me or one of my users." ; return 0} if {[getchanhost $x $chan] != ""} { set rhostmem [lindex [split [getchanhost $x $chan] @] 1] ; set rhostban [string trim [lindex [split $banhost @] 1] "\*\."] set lhostmem [lindex [split [getchanhost $x $chan] @] 0] ; set lhostban [string trim [lindex [split $banhost @] 0] "\*\!\."] if {[string match *$rhostban* $rhostmem] && [string match *$lhostban* $lhostmem]} {putquick "NOTICE $nick : I will not place ban on $bannick coz this hostmask belongs to me or one of my users." ; return 0} } } putquick "NOTICE $nick : Creating new ban on channel: $chan for: $banhost" newchanban $chan $banhost $hand $reason $bntime putcmdlog " <<$nick>> !$hand! ($chan) +ban $host $bntime $reason" ; return 0 } bind msg o|o -ban msg_-ban proc msg_-ban {nick uhost hand rest} { global botnick banlist if {![matchattr $hand f]} {putquick "NOTICE $nick : You haven't authenticate Yourself. Type: \[/msg $botnick auth \] to do so." ; return 0} set chan [lindex $rest 0] if {$chan == "#" || $chan == ""} {putquick "NOTICE $nick :Command: /msg $botnick -ban <#channel> " ; return 0} if {![string match "#*" $chan]} {set chan "#$chan"} if {![validchan $chan]} {putquick "NOTICE $nick :I am not on channel: $chan, check out my channel list." ; return 0} set rest [lrange $rest 1 end] if {$rest == ""} {putquick "NOTICE $nick :Command: /msg $botnick -ban <#channel> " ; return 0} if {![string match "*@*" $rest]} { if {![onchan $rest $chan]} {putquick "NOTICE $nick : $rest is not on channel: $chan." ; return 0 } else {set rest [getchanhost $rest $chan] ; set rest *!*@[lindex [split $rest @] 1]} } if {[string match *$rest* [lrange [banlist $chan] 0 end]]} { putquick "NOTICE $nick :Releasing current ban: $rest on channel: $chan" killchanban $chan $rest } else { putquick "NOTICE $nick :There are no Bans for: $rest on channel: $chan. Perhaps it was a Global Ban." ; return 0 } putcmdlog " <<$nick>> !$hand! ($chan) -ban $rest" ; return 0 } bind msg m +gban msg_+gban proc msg_+gban {nick uhost hand rest} { global botnick if {![matchattr $hand f]} {putquick "NOTICE $nick :You haven't authenticate Yourself. Type: \[/msg $botnick auth \] to do so." ; return 0} set rest [lindex $rest 0] if {[string match "#*" $rest]} {putquick "NOTICE $nick :Command: /msg $botnick +gban \[ban time (minute(s))\] \[reason\]" ; return 0} if {$rest == ""} {putquick "NOTICE $nick :Command: /msg $botnick +gban \[ban time (minute(s))\] \[reason\]" ; return 0} set bntime [lindex $rest 1] ; set reason [lrange $rest 2 end] set bntime [string trim $bntime "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+|~,./;'<>?:{}"] if {$bntime == ""} {set bntime 15} ; if {$reason == ""} {set reason "\[GLOBAL Ban\] Requested by: $nick"} set bannick [lindex $rest 0] if {[string match "*@*" $bannick]} {set host $bannick ; set banhost $host ; set banhand $host} else {set host "" ; set banhost "" ; set banhand ""} foreach x [channels] { set chan $x if {[onchan $bannick $chan]} {if {$host == "" || $banhost == "" || $bannick == ""} {set host [getchanhost $bannick $chan] ; set banhost *!*@[lindex [split $host @] 1] ; set banhand [nick2hand $bannick $chan]}} } if {$host == "" || $banhost == "" || $banhand == ""} {putquick "NOTICE $nick :  $bannick is not on any of my channel(s)." ; return 0} if {[string tolower $bannick] == [string tolower $botnick]} {putquick "NOTICE $nick :I will not ban on myself." ; return 0} if {[matchattr $banhand f]} {putquick "NOTICE $nick :I will not place ban on $bannick coz a hostmask of this user is included in my user list." ; return 0} foreach x [userlist] { if {[string match *$x* $banhost]} {putquick "NOTICE $nick :I will not place ban on $bannick coz this hostmask belongs to me or one of my users." ; return 0} if {[getchanhost $x $chan] != ""} { set rhostmem [lindex [split [getchanhost $x $chan] @] 1] ; set rhostban [string trim [lindex [split $banhost @] 1] "\*\."] set lhostmem [lindex [split [getchanhost $x $chan] @] 0] ; set lhostban [string trim [lindex [split $banhost @] 0] "\*\!\."] if {[string match *$rhostban* $rhostmem] && [string match *$lhostban* $lhostmem]} {putquick "NOTICE $nick :I will not place ban on $bannick coz this hostmask belongs to me or one of my users." ; return 0} } } putquick "NOTICE $nick :Creating new Global ban for: $banhost" newban $banhost $hand $reason $bntime putcmdlog " <<$nick>> !$hand! +gban $host $bntime $reason" ; return 0 } bind msg m -gban msg_-gban proc msg_-gban {nick uhost hand rest} { global botnick if {![matchattr $hand f]} {putquick "NOTICE $nick :You haven't authenticate Yourself. Type: \[/msg $botnick auth \] to do so." ; return 0} set rest [lindex $rest 0] if {[string match "#*" $rest]} {putquick "NOTICE $nick :Command: /msg $botnick -gban " ; return 0} if {$rest == ""} {putquick "NOTICE $nick :Command: /msg $botnick -gban " ; return 0} if {![isban $rest]} {putquick "NOTICE $nick :There are no Global Bans for: $rest." ; return 0} killban $rest ; regsub -all " " [channels] ", " chans putcmdlog " <<$nick>> !$hand! -gban $rest" ; return 0 } bind msg o|o baninfo msg_infoban proc msg_infoban {nick uhost hand rest} { global botnick set chan [lindex $rest 0] if {$chan == "#" || $chan == ""} {if {[string toupper $chan] != "GLOBAL"} {putquick "NOTICE $nick :Command: /msg $botnick baninfo <#channel|GLOBAL>" ; return 0}} if {[string toupper $chan] != "GLOBAL"} {if {![string match "#*" $chan]} {set chan "#$chan"}} set banlistchan "" if {[string toupper $chan] != "GLOBAL"} { if {![validchan $chan]} {putquick "NOTICE $nick :I am not on channel: $chan, check out my channel list." ; return 0} foreach x [banlist $chan] {set banlister [lindex $x 0] ; set banlistchan "$banlistchan $banlister"} if {[banlist $chan] == ""} {set banlistchan "empty"} putquick "NOTICE $nick :Ban records for channel: $chan: $banlistchan." putcmdlog " <<$nick>> !$hand! List Bans on: $banlistchan." ; return 0 } set banlist "" if {[string toupper $chan] == "GLOBAL"} { foreach x [banlist] {set banlisting [lindex $x 0] ; set banlist "$banlist $banlisting"} if {$banlist == ""} {set banlist "empty"} putquick "NOTICE $nick :Global Ban records: $banlist." putcmdlog " <<$nick>> !$hand! List Global Bans." ; return 0 } } bind msg o|o rlbans msg_lepasban proc msg_lepasban {nick uhost hand rest} { global botnick set chan [lindex $rest 0] if {$chan == "#" || $chan == ""} {putquick "NOTICE $nick :Command: /msg $botnick rlbans <#channel>" ; return 0} if {![string match "#*" $chan]} {set chan "#$chan"} if {![validchan $chan]} {putquick "NOTICE $nick :I am not on channel: $chan, check out my channel list." ; return 0} if {![botisop $chan]} {putquick "NOTICE $nick :I appologize, but I am not an Operator on channel: $chan. Your command cannot be perform." ; return 0} set ban "" ; foreach ban [banlist $chan] {putquick "MODE $chan +b [lindex $ban 0]"} ; putquick "MODE $chan +b" putquick "NOTICE $nick :Releasing all Bans on channel: $chan. Updating Ban records." putcmdlog " <<$nick>> !$hand! Release Bans on: $chan." ; return 0 } proc pub_lepasban {nick uhost hand chan rest} { global CHPRM botnick set channel [lindex $rest 0] if {$channel == ""} {set channel $chan} else {if {![string match "#*" $channel]} {set channel "#$channel"}} msg_lepasban $nick $uhost $hand $channel } bind msg n op msg_op bind msg n deop msg_deop bind msg n voice msg_voice bind msg n devoice msg_devoice bind msg - help msg_help proc msg_op {nick host handle arg} { if {![matchattr $nick f]} {return 0} global botnick set who [lindex $arg 0] set channel [lindex $arg 1] if {$who == ""} { putserv "notice $nick : Gunakan: /msg op " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick :$who no such in $channel. Wake UP!" return 1 } if {![isop $botnick $channel]} { putserv "notice $nick :I'am not Ops in $channel" return 1 } if {[isop $who $channel]} { putserv "notice $nick : $who allready opped in $channel" return 1 } putserv "MODE $channel +o $who" putlog "(**Command: .op by $nick on $channel for $who**)" return 1 } proc msg_deop {nick host handle arg} { if {![matchattr $nick f]} {return 0} global botnick set who [lindex $arg 0] set channel [lindex $arg 1] set n2hand [nick2hand $who $channel] if {[matchattr $nick m]} { putserv "MODE $channel -o $who" putlog "(**Command: .deop by $nick on $who in $channel**)" return 1 } if {$who == ""} { putserv "NOTICE $nick : Gunakan: /msg deop " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick : $who no such in $channel" return 1 } if {![isop $botnick $channel]} { putserv "NOTICE $nick :I'am not Ops in $channel" return 1 } if {[string tolower $who] == [string tolower $botnick]} { putserv "MODE $channel -o $nick" putserv "KICK $channel $nick :Never $botnick -o ???" putlog "(**Command: .deop by $nick on ME on $channel**)" return 1 } if {[matchattr $n2hand m]} { putserv "MODE $channel -o $nick" putserv "KICK $channel $nick :Never -o My Boss!!" putlog "(**Command: .deop by $nick on $who a MASTER, on $channel**)" return 1 } if {![isop $who $channel]} { putserv "NOTICE $nick :Where is $who ?? gone !!!" return 1 } putserv "MODE $channel -o $who" putlog "(**Command: .deop by $nick on $who in $channel**)" return 1 } proc msg_voice {nick host handle arg} { if {![matchattr $nick f]} {return 0} global botnick set who [lindex $arg 0] set channel [lindex $arg 1] if {$who == ""} { putserv "notice $nick : Gunakan: /msg voice " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick : $who no such $channel. Wake UP!" return 1 } if {![isop $botnick $channel]} { putserv "notice $nick :I do not voice in $channel" return 1 } if {[isop $who $channel]} { putserv "notice $nick : $who allready Voice in $channel" return 1 } putserv "MODE $channel +v $who" putlog "(**Command: .Voice by $nick on $channel for $who**)" return 1 } proc msg_devoice {nick host handle arg} { if {![matchattr $nick f]} {return 0} global botnick set who [lindex $arg 0] set channel [lindex $arg 1] if {$who == ""} { putserv "notice $nick : Gunakan: /msg devoice " return 1 } if {![onchan $who $channel]} { putserv "NOTICE $nick : $who no such in $channel. Wake UP!" return 1 } if {![isop $botnick $channel]} { putserv "notice $nick :I do not DeVoice in $channel" return 1 } if {[isop $who $channel]} { putserv "notice $nick : $who allready deVoice in $channel" return 1 } putserv "MODE $channel -v $who" putlog "(**Command: .DeVoice by $nick on $channel for $who**)" return 1 } proc msg_help { nick userhost handle args} { putserv "privmsg $nick :Basic commands fo Eggdrop by msg:" putserv "privmsg $nick :.kick Gunakan: /msg kick Kick that person of the channel" putserv "privmsg $nick :.+ban Gunakan: /msg +ban <*!*@ip> Add a Ban on a channels for the person" putserv "privmsg $nick :.-ban Gunakan: /msg -ban <*!*@ip> del a Ban on a channels for the person" putserv "privmsg $nick :.+gban Gunakan: /msg +gban <*!*@ip> Add a permanent Ban on all channel for the person" putserv "privmsg $nick :.-gban Gunakan: /msg -gban <*!*@ip> del a permanent Ban on all channels for the person" putserv "privmsg $nick :.op Gunakan: /msg op Ops a user in the channel" putserv "privmsg $nick :.deop Gunakan: /msg deop Deops a user in the channel" putserv "privmsg $nick :.voice Gunakan: /msg voice Gives voice to a user" putserv "privmsg $nick :.devoice Gunakan: /msg devoice Gives DEvoice to a user" } ## public cmd auth -- start proc pub_auth {nick uhost hand chan rest} { global CC botnick if {[matchattr $hand Q] == 0} { puthelp "PRIVMSG $chan :${nick}, 4Auth First!!" } if {[matchattr $hand Q] == 1} { puthelp "PRIVMSG $chan :${nick}, 3siap melaksanakan tugas bos" } } ## public cmd auth -- stop set vers "v3.6.1" putlog "=== HanikEgg Master TCL Loaded"