Script Name:
unloader.tcl
Version: 1.0
Author: rojo
Script Date: 18/05/2011
Category: Not specified
Downloads: 35
File Name:
unloader.tcl.gz
Short Description:
Adds a DCC command to unload scripts without needing to restart the bot; automatically cleans up unreferenced global variables, broken bindings, and orphaned / duplicate timers on load / rehash.
Extended Description File
When the bot is loaded or rehashed, this script will find and delete
any unreference global variables, as well as delete any bindings which call
a non-existent proc. Think of it as a memory optimizer for your eggdrop.
When this script is used to unload another script, it reads the target
script to be unloaded. It scrapes and deletes the namespaces and global
procs it finds. The script then looks at all active binds and timers, and
deletes those for which no command exists. Finally, it wraps the remaining
binds into a failsafe watchlist. If the triggered command executes
successfully, the original binding is restored and the failsafe wrapper
proc is deleted. Otherwise, the binding is considered to be orphaned, and
is dropped for good.
A rehash restores all bindings and reloads whatever scripts are
sourced in eggdrop.conf.