hey all is there a way to make a trigger that will load 1 or more backup scripts if the main channel bot gose in a netsplit i know how to do it in mIRC script but not tcl eg:
or load more than one sctipt and unload then as abouve would be just a simple break and /load -rs script2.mrc then message
anyone know how this can be done in tcl so and eggdrop bot would load the backup script
thanks for anyhelp
Probably not possible due to the simple fact that the eggdrop's configuration file needs editing followed by a rehash; it's not a simple matter of /load or /unload.
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
edit: ok it there a way to have the script loaded but none of the triggers in the script to work untill the channel trigger is used ie !bload and deactivate on !bunload ?
like instead of loading the script with a /load command have the script loaded in the bot but it will be idle untill the trigger is given in the channel by an op halfop or voice.
say the normal bot is in the channel and someone uses !trigger1 the backup bot wont reply but if the !bload command is given on a netsplit the !trigger1 will work and the bot will reply to the channel triggers.
bind pub n !bload bload
proc bload {nick uhost hand chan arg} {
if {![catch {source [lindex [split $arg] 0]} e]} {
puthelp "privmsg $chan :Loaded [lindex [split $arg] 0]."
} {
puthelp "privmsg $chan :An error occured while trying to load [lindex [split $arg] 0]: $e"
}
}
As for unloading, I don't think you can do that BUT you can still unbind all binds assiciated with the loading script but that will need some extra coding.
Sir_Fz : There is no need to use '[lindex [split $arg] 0]' three times, why don't you just '[set foo [lindex [split $arg] 0]]' then use $foo instead of two '[lindex [split $arg] 0]'?
As for loading/unloading a script in the TCL Archive is a script called 'Unloadtcl' by Wingman that 'Allows you to load and unload Tcl scripts using DCC commands.' give it a try. I know is old and a bit outdated.. egghead's 'freshmint' (it's a script, check it's webpage, don't know if he added in the TCL Archive) is realy nice.
Once the game is over, the king and the pawn go back in the same box.
at least you can't know which binds belong to that script; parsing the source (as that wingman guy's script probably does) is crude and inacurate way of obtaining such info
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use
demond : Actualy egghead's 'freshmint' dose the cleaning. And no, you don't need to unbind just the binds of that tcl script in question since upon rehash your conf file is reloaded also all your tcl scripts are reloadsed, meaning that all the binds are (re)created so, the binds from the 'unloaded' script won't be binded again because that script isn't loaded because isn't there. Simple.
Wingman's 'Unloadtcl' just opens your conf file and either appends or removes a certain line with the script you wish either to load or remove.
Once the game is over, the king and the pawn go back in the same box.
as simple as it might be, it's actually more crude than I thought
I am forced to reload all other scripts in order to unload one? what if I don't want to do that? I might have some scripts in intermediate states, which will screw up their current states on forced reload, what about that? what if I don't want my config modified? what if the script I want to unload is not sourced directly in the config, but indirectly by some other script?
it ain't that easy as it sounds
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use
Oh well, it works fine for me. I don't like to complicate stuff. And you aren't forced to reload all the scripts since that already happens when you either rehash or restart the bot. Anyway, is not 100% perfect BUT it's doing exactly what I needed.
Once the game is over, the king and the pawn go back in the same box.
I personally wouldn't recommend a script which won't work for everybody; but then again, there's only a handful of correct eggdrop scripts, unfortunately
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use