- Home»
- Cod sursa: ezbounce.tcl
ezbounce.tcl
ezbounce.tcl
It (almost) only uses the EZBounce whenever the bot can't connect directly to any servers in its servers list.
| Postat de | Copyright | Categorie | Review user | Vizualizari | Data |
|---|---|---|---|---|---|
| btc | FireEgl | activity | Cod netestat | 366 | 2023-12-25 08:43:50 |
# ezbounce.tcl v1.1 - by FireEgl@EFNet <FireEgl@LinuxFan.com> - 12/25/99
### Description:
# It (almost) only uses the EZBounce whenever the bot can't
# connect directly to any servers in its servers list.
### Reasons:
# Same reason I wrote fbnc.tcl, but I decided to use EZBounce,
# since my shell provider hates BNC and loves EZBounce.
### Notes:
# It's only been tested with EZBounce v0.99.2 and Eggdrop v1.4.0.
# Also, keep in mind that it may takes hours for the bot to
# get on IRC via the EZBounce if you have a large servers list
# and high values for server-timeout and server-cycle-wait.
### Future Plans for This Script:
# None. =P But if you improve this script then
# release what you did and send me a copy. =)
# Report Bugs and Stuff to FireEgl@LinuxFan.com
### Options:
# hostname of the EZBounce:
set ezb(host) "Your.Vhost.com"
# port number of the EZBounce:
set ezb(port) "16667"
# password on the EZBounce:
set ezb(pass) "yourpass"
# list of vhosts to use on the EZBounce:
# (Note, one random one will be selected on each connect to the EZBounce)
set ezb(vhosts) {
Fr0mThe.Net
NBits.cOm
Pffft.cOm
SquidCafe.cOm
ZBaLa.cOm
}
### End Options - You Shouldn't Need To Edit Anything Below Here.
bind notc - "*Please use /quote PASS <password> to register*" notc:ezbounce:pass
bind notc - "*Use /quote CONN <server>:*" notc:ezbounce:conn
proc notc:ezbounce:pass {nick host hand text} {
if {"$host" == "ezbounce!serv@ezbounce.net"} {
putlog "Accepted ezbounce!serv@ezbounce.net...sending pass."
global ezb
putserv "PASS $ezb(pass)"
}
}
proc notc:ezbounce:conn {nick host hand text} {
if {"$host" == "ezbounce!serv@ezbounce.net"} {
global username ezb servers
putserv "IDENT $username[rand 99]"
putserv "INTERFACE [lindex $ezb(vhosts) [rand [llength $ezb(vhosts)]]]"
putserv "CONN [lindex $servers [rand [llength $servers]]]"
}
}
# It really doesn't need this proc at all, since when it tries to connect to a
# server once it adds that server to the bottom of the $servers list. (it does on mine anyway!)
proc ezb_server_check {} {
global server ezb server-cycle-wait server-timeout servers
if {"$server" == ""} {
putlog "\[\002EZB\002\] Attempting to Connect to EZBounce @ $ezb(host) $ezb(port)..."
jump $ezb(host) $ezb(port)
}
foreach t "[utimers]" { if {[string match [string tolower "ezb_server_check"] "[string tolower [lindex $t 1]]"]} { killutimer "[lindex $t 2]" } }
# The expr here gets a relative idea of how long it takes the bot to try all the servers in its server list:
utimer [expr [llength $servers] * (${server-cycle-wait} + ${server-timeout})] ezb_server_check
}
# Init.:
foreach t "[utimers]" { if {[string match [string tolower "ezb_server_check"] "[string tolower [lindex $t 1]]"]} { killutimer "[lindex $t 2]" } }
if {![info exists server-cycle-wait]} { set server-cycle-wait "[expr 1 + [rand 3]]" }
if {![info exists server-timeout]} { set server-timeout "[expr 20 + [rand 9]]" }
utimer [expr [llength $servers] * (${server-cycle-wait} + ${server-timeout}) + 99] ezb_server_check
putlog "ezbounce.tcl v1.1 - by FireEgl@EFNet <FireEgl@LinuxFan.com> - Loaded."
IRC Snippets