Welcome.level6 wrote:Hi. New here, ...
Wouldn't that be the global variable, botnick ?Is there any [built-in] way to determine the eggdrop bot's own nick at any given time?
I think that I'm not understanding you.What I really want is to allow it to become self-aware of its own attributes via getuser with the BOTFL, but those functions appear to be dependent on nick. If there is any way to get "my own" attributes on each bot, that would work, too.
What would trigger the behavior to which they would react differently?My end game is to be able to write and distribute a single script for all bots on a botnet, then have leaf bots behave differently than hub bots using code in that script. I am just getting tired of maintaining two scripts for every thing (one for hubs, one for leaves). So, if I am missing some other obvious way to do this, please let me know.
Code: Select all
[code/]
Code: Select all
# not going to work...
set bothandle [nick2hand $botnick]
if {[set nfo [getuser $bothandle BOTFL]] != "" && [string match "*h*" $nfo]} {
set ismaster=1
} else {
set ismaster=0
}
if {$ismaster}
{
bind pub - .attack botnet_fruitattack_pub
bind dcc - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"
} else {
bind bot - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"
}
Code: Select all
.
.
if {$ismaster} {
putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"
putallbots "attack $whotoattack $chan"
dccbroadcast "MASTER $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "MASTER $botnick - Command sent to all bots!"
} else {
putlog "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
}
putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"
.
.
Code: Select all
set ismaster 1
Code: Select all
proc botnet_fruitattack_pub {nick uhost handle chan argv} {
.
.
global ismaster
global botnick
.
.
if { $ismaster == 1 } {
putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"
putallbots "attack $whotoattack $chan"
dccbroadcast "MASTER $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "MASTER $botnick - Command sent to all bots!"
} else {
putlog "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
}
putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"
.
.
Code: Select all
if {$ismaster == 1} {
bind pub - .attack botnet_fruitattack_pub
bind dcc - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"
} else {
bind bot - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"
}
Code: Select all
[08:28:26] MASTER liar - Sending orders to all bots to Fruit Attack!
*** MASTER liar - Command accepted. I will stabs tda with a basket of peaches!
*** MASTER liar - Command sent to all bots!
*** (liar_botnet_1) SLAVE liar_botnet_1 - Command accepted. I will teabags tda with passion fruits!
*** (liar_botnet_2) SLAVE liar_botnet_2 - Command accepted. I will pummels tda with bananas!
Code: Select all
proc botnet_fruitattack_pub {nick uhost handle chan argv} {
if {[regexp {[\{]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\}]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\']} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\"]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\!]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\`]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
set whotoattack [lindex $argv 0]
global ismaster
global botnick
set verb {
"rapes"
"makes passionate love to"
"pummels"
"stabs"
"plays hide-the-fruit with"
"teabags"
"socks the [censored] outta"
"replaces the existance of"
"shoots laser beams at"
"makes emo poetry at"
}
set fruit {
"apples"
"bananas"
"oranges"
"mangos"
"pinnapples"
"pears"
"passion fruits"
"a bunch of grapes"
"a bag of plums"
"a basket of peaches"
}
if {$whotoattack == ""} {
putserv "NOTICE $chan :ERROR\: Please supply a nick to attack. derp."
return 0
}
if {$whotoattack == "spin"} {
putserv "NOTICE $chan :ERROR\: Nawp. Ain't gunna do eet. derp."
return 0
}
if {![onchan $whotoattack $chan]} {
putserv "NOTICE $chan :ERROR\: No such person here, dummay."
return 0
}
set how [lindex $verb [rand [llength $verb]]]
set what [lindex $fruit [rand [llength $fruit]]]
if { $ismaster == 1 } {
putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"
putallbots "attack $whotoattack $chan"
dccbroadcast "MASTER $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "MASTER $botnick - Command sent to all bots!"
} else {
putlog "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
}
putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"
return 1
}
proc botnet_fruitattack {handle idx argv} {
if {[regexp {[\{]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\}]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\']} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\"]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\!]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
if {[regexp {[\`]} $argv]>0} {
putserv "NOTICE $chan :ERROR\: OK! Dumping my /etc/shadow file ... please wait."
return 0
}
set whotoattack [lindex $argv 0]
set chan "#LIEnet"
global ismaster
global botnick
set verb {
"rapes"
"makes passionate love to"
"pummels"
"stabs"
"plays hide-the-fruit with"
"teabags"
"socks the [censored] outta"
}
set fruit {
"apples"
"bananas"
"oranges"
"mangos"
"pinnapples"
"pears"
"passion fruits"
"grapes"
}
if {$whotoattack == ""} {
putserv "NOTICE $chan :ERROR\: Please supply a nick to attack. derp."
return 0
}
set how [lindex $verb [rand [llength $verb]]]
set what [lindex $fruit [rand [llength $fruit]]]
if { $ismaster == 1 } {
putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"
putallbots "attack $whotoattack $chan"
dccbroadcast "MASTER $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "MASTER $botnick - Command sent to all bots!"
} else {
putlog "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
dccbroadcast "SLAVE $botnick - Command accepted. I will $how $whotoattack with $what!"
}
putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"
return 1
}
if {$ismaster == 1} {
bind pub - .attack botnet_fruitattack_pub
bind dcc - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"
} else {
bind bot - attack botnet_fruitattack
putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"
}