- Home»
- Cod sursa: join.part.tcl
join.part.tcl
join.part.tcl
This is a simple script that allows you to type .Join #channelname or .part #Channelname from the DCC Chat window of your bot.
| Postat de | Copyright | Categorie | Review user | Vizualizari | Data |
|---|---|---|---|---|---|
| btc | gaiden | chanops | Cod netestat | 430 | 2023-12-25 09:40:48 |
# This is a simple script that allows you to type .Join #channelname or
# .part #Channelname from the DCC Chat window of your bot. I Personally did
# not write this script. I edited it. I took all of the info from ^Dino-'s
# Custom.tcl and he in turn got peices from other scripts. I'm not sure
# where any of it originates.
# I'm already aware of a bug when you part a Non-existant channel and am
# trying to remedy that.
# This is my very first attempt at tcl scripting and was real happy that
# the thing even worked! I hope it does you some good as well.
#
# 1.04: I added support for keykeep 1.02. If you are not using keykeep 1.02
# then you need to rem out the line marked below in the .join section
#
# 1.05: changed script to work with Eggdrop 1.3.5
#
# `RoyG
#
# 1.06 Begin gmods
#
# + support for new channel defs (dontkickops etc)
# - console entry for the #married channel (what the hell was this for?)
# - check for # -- Why not just add it if it aint there?
# - spy stuff. There is no difference in that stuff and joinin
# - chanban procs. The new eggdrops (1.3.21) do all this anyways
# + made the channel sets friendly so you dont op the bot and
# watch it go nutz in the channel making ops mad ;)
#
# hey, how much more can a join/part script do?!
# gaiden (EFNet)
## .JOIN ##
bind dcc m JOIN dcc_join_chan
proc dcc_join_chan {handle idx arg} {
global botnick chan
set chan [lindex $arg 0]
set chans [channels]
set why [lrange $arg 1 end]
foreach chann $chans {
if {[string tolower $chann] == [string tolower $chan]} {
putdcc $idx "$handle JOIN Error: I'm already on $chan "
return 0
}
}
if {$chan == ""} {
putdcc $idx "$handle JOIN Error: Usage: .join <Channel>"
return 0
}
if {[string index $chan 0] != "#"} {
set chan "#$chan"
}
channel add $chan {
chanmode "+nt"
idle-kick 20
need-op {request_ops $chan }
need-invite {gimmie_da_key $chan }
need-key {gimmie_da_key $chan }
need-unban {gimmie_da_key $chan }
need-limit {gimmie_da_key $chan }
flood-chan 10:60
flood-deop 3:10
flood-kick 3:10
flood-join 5:60
flood-ctcp 3:60
}
channel set $chan -bitch +secret -autoop -clearbans -stopnethack +enforcebans
channel set $chan -greet -revenge +dynamicbans -protectops -statuslog +userbans
channel set $chan +shared -autovoice +cycle +seen +dontkickops +dontdeopops
putlog "$handle added $chan to my monitor list"
return 1
}
## .PART ##
bind dcc m PART dcc_part_chan
proc dcc_part_chan {handle idx vars} {
global botnick
set where [lindex $vars 0]
set chans [channels]
if {$where == ""} {
putdcc $idx "$handle PART Error: Usage: part <Channel you want me to leave>"
return 0
}
if {[string index $where 0] != "#"} {
set where "#$where"
}
if {![string match *[string tolower $where]* [string tolower $chans]]} {
putdcc $idx "$handle PART Error: I'm not on $where."
return 0
}
channel remove $where
putlog "No longer monitoring $where as per request from $handle."
return 1
}
putlog "Join/Part 1.06 by `RoyG + gmods installed"
# Leagal Stuff:
# THIS SCRIPT IS OFFERED "AS IS" AND "WITH ALL FAULTS."
# WE MAKE NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
# CONCERNING THE QUALITY, SAFETY OR SUITABILITY OF THE SOFTWARE,
# EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
# ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
# A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
# IN NO EVENT WILL WE BE LIABLE FOR
# INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
# ANY DAMAGES HOWEVER THEY MAY ARISE AND EVEN IF WE HAVE BEEN
# PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
IRC Snippets