alias bnsetvars {
;##set this to a port you want to listen for bots on##
set %bnport 3004
;##set this to a pass you want for your bot##
set %bnpass triv
;##set this to your bots name##
set %bnnick Commando
}
alias bnlisten {
bnsetvars
socklisten botnet %bnport
}
on 1:socklisten:botnet:{
sockaccept connecting
echo botnet notice: connecting bot connecting
sockwrite connecting name: %bnnick $crlf
}
on 1:sockread:connecting:{
sockread %bntemp
echo connecting bot sent: %bntemp
IF ($gettok(%bntemp,1,32) == ack:) {
echo connecting bot sent ack... sending pass request
sockwrite connecting pass? $crlf
}
if ($gettok(%bntemp,1,32) == pass:) {
if ($gettok(%bntemp,2,32) == %bnpass) {
sockmark connecting pass
sockwrite connecting notice: PASS ACCECPTED -- WAITING FOR NICK $crlf
sockwrite connecting name? $crlf
bnsuccess connecting bot sent pass -- pass accectped
}
ELSE {
sockwrite connecting error: WRONG PASS -- CLOSING LINK $crlf
sockclose connecting
bnerror connecting bot sent pass -- pass rejected -- closing link
}
}
ELSEIF ($gettok(%bntemp,1,32) == name:) {
if ($sock(connecting).mark == pass) {
sockwrite connecting success: WELCOME $gettok(%bntemp,2,32) -- YOU ARE NOW CONNECTED TO THE BOTNET $crlf
sockrename connecting BN- $+ $gettok(%bntemp,2,32)
bnsuccess $gettok(%bntemp,2,32) IS NOW CONNECTED TO THE BOTNET
}
ELSE {
sockwrite connecting error: you did not send the pass -- connection rejected -- closing link
sockclose connecting
bnerror connecting bot did not send pass -- connection rejected -- closing link
}
}
unset %bntemp
}
alias bnsendall {
sockwrite BN-* $1- $crlf
}
alias bnsend {
sockwrite BN- $+ $1 $2- $crlf
}
alias bnerror {
echo 4,1botnet error: $1- $crlf
bnsendall error: $1- $crlf
}
alias bnsuccess {
echo 9,1botnet success: $1- $crlf
bnsendall success: $1- $crlf
}
alias bnnotice {
echo 8,1botnet notice: $1- $crlf
bnsendall notice: $1- $crlf
}
on 1:sockread:BN-*:{
sockread %bntemp
if ($gettok(%bntemp,1,32) == ping:) {
sockwrite $sockname pong: $gettok(%bntemp,1,32)
echo botnet ping pong
}
if ($gettok(%bntemp,1,32) == pong:) {
echo botnet recieved pong from $mid($sockname,3,0)
}
if ($gettok(%bntemp,1,32) == op:) {
/mode $gettok(%bntemp,2,32) +o $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == deop:) {
/mode $gettok(%bntemp,2,32) -o $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == voice:) {
/mode $gettok(%bntemp,2,32) +v $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == devoice:) {
/mode $gettok(%bntemp,2,32) -v $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == hop:) {
/mode $gettok(%bntemp,2,32) +h $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == dehop:) {
/mode $gettok(%bntemp,2,32) -h $gettok(%bntemp,3,32)
}
if ($gettok(%bntemp,1,32) == rejoin:) {
/part $gettok(%bntemp,2,32)
/join $gettok(%bntemp,2,32)
}
if ($gettok(%bntemp,1,32) == join:) {
/join $gettok(%bntemp,2,32)
}
if ($gettok(%bntemp,1,32) == part:) {
/part $gettok(%bntemp,2,32)
}
if ($gettok(%bntemp,1,32) == mode:) {
/mode $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == topic:) {
/topic $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == error:) {
echo 4,1botnet error: $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == success:) {
echo 9,1botnet success: $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == notice:) {
echo 8,1botnet notice: $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == server:) {
server -m $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == current:) {
$c($gettok(%bntemp,2-,32))
}
if ($gettok(%bntemp,1,32) == say:) {
/msg $gettok(%bntemp,2,32) $gettok(%bntemp,3-,32)
}
if ($gettok(%bntemp,1,32) == act:) {
/msg $gettok(%bntemp,2,32) $chr(1) $+ ACTION $gettok(%bntemp,3-,32) $+ $chr(1)
}
if ($gettok(%bntemp,1,32) == kick:) {
/kick $gettok(%bntemp,2,32) $gettok(%bntemp,3,32) $gettok(%bntemp,4-,32)
}
if ($gettok(%bntemp,1,32) == auser:) {
auser $gettok(%bntemp,3,32) $gettok(%bntemp,2,32)
}
if ($gettok(%bntemp,1,32) == pass?) {
echo sent pass
sockwrite $sockname pass: %bntmppass $crlf
unset %bntmppass
}
ELSEIF ($gettok(%bntemp,1,32) == name?) {
echo sent name
sockwrite $sockname name: %bnnick $crlf
}
unset %bntemp
}
alias /bnping {
if ($1 = all) {
bnsendall ping: %bnnick
} else {
bnsend $1 ping: %bnnick
}
}
alias /bnop {
bnsendall op: $1 $2
}
alias /bndeop {
bnsendall deop: $1 $2
}
alias /bnvoice {
bnsendall voice: $1 $2
}
alias /bndevoice {
bnsendall devoice: $1 $2
}
alias /bnhop {
bnsendall hop: $1 $2
}
alias /bndehop {
bnsendall dehop: $1 $2
}
alias /bnrejoin {
if ($1 = all) {
bnsendall rejoin: $2
} else {
bnsend $1 rejoin: $2
}
}
alias /bnsay {
if ($1 = all) {
bnsendall say: $2 $3-
} else {
bnsend $1 say: $2 $3-
}
}
alias /bnact {
if ($1 = all) {
bnsendall act: $2 $3-
} else {
bnsend $1 act: $2 $3-
}
}
alias /bnkick {
bnsendall kick: $1 $2 $3-
}
alias /bnjoin {
if ($1 = all) {
bnsendall join: $2
} else {
bnsend $1 join: $2
}
}
alias /bnpart {
if ($1 = all) {
bnsendall part: $2
} else {
bnsend $1 part: $2
}
}
alias /bnmode {
bnsendall mode: $1 $2
}
alias /bntopic {
bnsendall topic $1 $2
}
alias /bnerror {
if ($1 = all) {
bnsendall error: $2-
} else {
bnsend $1 error: $2-
}
}
alias /bnsuccess {
if ($1 = all) {
bnsendall success: $2-
} else {
bnsend $1 success: $2-
}
}
alias /bnnotice {
if ($1 = all) {
bnsendall notice: $2-
} else {
bnsend $1 notice: $2-
}
}
alias /bnserver {
if ($1 = all) {
bnsendall server: $2
} else {
bnsend $1 server: $2
}
}
alias /bncurrent {
if ($1 = all) {
bnsendall current: $2
} else {
bnsend $1 current: $2
}
}
alias /bnauser {
if ($1 = all) {
bnsendall auser: $2 $3
} else {
bnsend $1 auser: $2 $3
}
}
alias /bnhelp {
/window @bnhelp
/loadbuf @bnhelp bnhelp.txt
}
alias /bndrop {
bnerror dropping connection to bot $1 reason -- $2-
sockclose BN- $+ $1
}
alias /bnconnect {
/sockopen connect $1 $2
set %bntmppass $3
}
on 1:sockread:connect:{
set %bnloop 1
sockread %bntemp
echo %bntemp
IF ($gettok(%bntemp,1,32) == name:) {
echo sent to: $sockname ack: $crlf
sockwrite $sockname ack: $crlf
sockrename connect BN- $+ $gettok(%bntemp,2,32)
}
unset %bntemp
}
if ($gettok(%bntemp,1,32) == error:) {
echo 4,1botnet error: $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == success:) {
echo 9,1botnet success: $gettok(%bntemp,2-,32)
}
if ($gettok(%bntemp,1,32) == notice:) {
echo 8,1botnet notice: $gettok(%bntemp,2-,32)
}
unset %bntemp
}