I'm running a small botnet to experience how to share services between eggdrops; I have one hub (Dr0_0pY) , and one leaf (Sn0_0pY), and am trying to run services (a googler or wheaterscript for example).
I tried two solutions, loading them from scripts (eggdrop.conf) and from netbots (as component).
When running from scripts, both bots reply my requests.
When running from netbots, only the hub replies, but when the hub is down, the leaf does'nt react neither.
So now I'm trying to write a script, that would be performed on all bots, in order to determine the "active_bot" and to ensure non redundant services at any time (googler or meteo should be modified in accordance with some "if {botnick == active_bot} {...} else return 0"
I decided to perform this on join part, as bots are relatively stable, have vhosts and are on an unreal server which is secured.
Code: Select all
bind join - *!*@*jupi.botnet act_testjoin
bind part - *!*@*jupi.botnet act_testpart
# This is where i put the list of bots, I guess there is a command to pull it out, but didn't couldn't find it
set act_botlist [list Dr0_0pY Sn0_pY]
proc act_testpart {nick host hand chan msg} {
global act_botlist
foreach element $act_botlist {
if {[onchan $element $chan] == 1 } {set act_bot $element
putserv "PRIVMSG $chan : $nick is gone the active bot is $act_bot";break}
}
}
proc act_testjoin {nick host hand chan} {
global act_botlist
foreach element $act_botlist {
if {[onchan $element $chan] == 1 } {set act_bot $element
putserv "PRIVMSG $chan : $nick came back! the active bot is $act_bot";break}
}
}
Does anyone have a hint?
Thank you