robodr1pn

This commit is contained in:
.[d]. 2021-03-08 07:16:21 -06:00
parent 3e6dbcb08a
commit 21b53de7bc
3 changed files with 167 additions and 109 deletions

17
plugins/b33p.py Normal file
View File

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from irc3.plugins.command import command
import irc3
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
@command(permission='view')
def (self, mask, target, args):
"""b33p
%%b33p
"""
robostep='{}: b00p'.format(mask.nick)
self.bot.privmsg(target,robostep)

View File

@ -5,6 +5,8 @@ import os
import random
import ipdb
from random import randint
from re import compile
from irc3 import rfc
dir_path = os.path.dirname(os.path.realpath(__file__))
@ -13,7 +15,7 @@ BOTNAMES = []
BOTNICKS = []
TOTAL_BOTS = 0
READY_BOTS = []
LOCK_KRYLON = 1
LOCK_KRYLON = 1 # 1
INTERRUPTED = 0
class KRYLON():
@ -81,47 +83,76 @@ class Plugin(object):
def spraying(self, mask, channel, **kw):
s=self
s._kbr = []; s._kbw = []; s._kbl = [];
s._chn = channel
s._ptr = KRYPTR[0]
for index in range(len(s._ptr.BOTS_MODE_READ)):
s._kbr.append(s._ptr.BOTS_MODE_READ[index])
s._kbw.append(s._ptr.BOTS_MODE_WRIT[index])
s._kbl.append(s._ptr.KRYLON_FILE_LOCK[index])
self.kbr = []; self.kbw = []; self.kbl = [];
self.chn = channel
self.ptr = KRYPTR[0]
s._fbu = s._ptr.FILE_BUFFER
s._fli = s._ptr.FILE_LINES
s._fin = s._ptr.FILE_INDEX
s._bna = BOTNAMES
s._bni = BOTNICKS
for index in range(len(self.ptr.BOTS_MODE_READ)):
self.kbr.append(self.ptr.BOTS_MODE_READ[index])
self.kbw.append(self.ptr.BOTS_MODE_WRIT[index])
self.kbl.append(self.ptr.KRYLON_FILE_LOCK[index])
self.fbu = self.ptr.FILE_BUFFER
self.fli = self.ptr.FILE_LINES
self.fin = self.ptr.FILE_INDEX
self.bna = BOTNAMES
self.bni = BOTNICKS
self.b1n = BOTNICKS.index(self.context.nick)
if s._ptr.INIT == 0:
s._ST8 = 0
s._ptr.INIT = 1
if s._ST8 <= 5 and KRYPTR[0].FINISHED == 1:
s._int = INTERRUPTED
if self.ptr.INIT == 0:
self._ST8 = 0
self.ptr.INIT = 1
if self._ST8 <= 5 and KRYPTR[0].FINISHED == 1:
self.int = INTERRUPTED
INTERRUPTED = 0
s._ST8 = 3
self._ST8 = 3
self.who = self.context.nick
#INIT FIRST PASS
try:
if self.ptr.INIT == 0:
print('<<<<<<> JUST INIT <>>>>>>') # test if initialized for first pass, fails on purpose
except:
self.STARTED = 1
self.FINISHED = 0
self.exe = 1 # set to recognize execution
self.cyc = 0 # how many cycles within this operation, e.g. amount of bots pass through this function
self.ops = 0 # how many completed operations, cycles reset, ops continue to count
for y in len(self.context.config.botnet):
if not y == self.b1n:
self.kbr[y] = 0
else:
self.kbw[y] = 1
self.context.privmsg("#sh0rtbus","rfc test")
s._who = self.context.nick
@irc3.event(irc3.rfc.JOIN)
def welcome(self, mask, channel, **kw):
if LOCK_KRYLON == 1:
if mask.nick == self.context.nick:
READY_BOTS.append(self.context.nick)
BOTCNT = len(self.context.config.botnet)
if len(READY_BOTS) == BOTCNT:
TOTAL_BOTS = BOTCNT;
BOT=self.context
CHN=channel
k=KRYLON(BOT,CHN)
KRYPTR.append(k)
self.spraying(mask,channel,**kw)
B0T = self.context
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
READY_BOTS.append(self.context.nick)
BOTCNT = len(self.context.config.botnet)
if len(READY_BOTS) == BOTCNT:
TOTAL_BOTS = BOTCNT;
BOT=self.context
CHN=channel
k=KRYLON(BOT,CHN)
KRYPTR.append(k)
self.spraying(mask,channel,**kw)
@irc3.event(irc3.rfc.CONNECTED)
def connected(self, **kw):
@ -133,10 +164,26 @@ class Plugin(object):
BOTNICKS.append(kw['me'])
self.context.join(self.channel)
@irc3.event(rfc.PRIVMSG, iotype="out")
def krylon_event(bot, mask=None, event=None, target=None, data=None):
self._add_event(event, user=mask, data=data, channel=target)
# bot.context.privmsg("#sh0rtbus","this bot: {} sent smth".format(bot.nick))
# ipdb.set_trace()
@irc3.event(irc3.rfc.PRIVMSG)
def on_privmsg(self, mask=None, data=None, **kw):
B0T=self.context
self.BYPASSING=0
if mask.nick == 'd': self.BYPASSING=1
if self._ST8 == 2:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< initial complications getting into the areas to do art ops, a server/channel/max-limit/key or invite only type issue >>"
@ -146,19 +193,19 @@ class Plugin(object):
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
if self._ST8 >= 3:
if self._ST8 >= 3 or self.BYPASSING == 1:
NOTBOT=0
B0T = self.context
CHN = B0T.config.channel
try:
B1N = BOTNICKS.index(b0t.nick)
B1N = BOTNICKS.index(B0T.nick)
except:
pass
if not mask.nick == b0t.nick:
if not mask.nick == B0T.nick:
NOTBOT=1
if self.STARTED == 1 and self.FINISHED == 0:
if KRYPTR[0].STARTED == 1 and KRYPTR[0].FINISHED == 0:
if not self._fli <=0:
self.INTERRUPTED+=1
rando = random.randint(1,5)
@ -179,15 +226,8 @@ class Plugin(object):
KRYPTR[0].FILE_INDEX = 0
self.spraying(mask,self.channel,**kw)
self._ST8 = 5
#above is dealing with human
else:
#below is dealing with bot art scrolling
NOTBOT=0
if self._ST8 == 3:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
@ -198,77 +238,77 @@ class Plugin(object):
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
if self._ST8 == 4:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< done with no interruptions >>"
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 4:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MSG="<< done with no interruptions >>"
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
if self._ST8 == 5:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MENTALITY=self.INTERRUPTED
DIAGNOSIS=''
if MENTALITY < 3:
DIAGNOSIS='mild'
elif MENTALITY > 5 and mentality < 10:
DIAGNOSIS='notice me notice me type,'
elif MENTALITY > 10 and MENTALITY <= 20:
DIAGNOSIS='jack hoffish and almost k00nt like'
elif MENTALITY > 35 and MENTALITY < 50:
DIAGNOSIS='almost twitter/facbook/google type censorship'
elif MENTALITY >= 50:
DIAGNOSIS='semi-stalkerish, you know... probably have not even received their actual valentine card yet. definitely got lost in the mail im sure but hey, show on this teddy bear where this artwork hurts you kind of'
MSG="<< done with some {} interruptions >>".format(DIAGNOSIS)
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 5:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MENTALITY=self.INTERRUPTED
# DIAGNOSIS=''
# if MENTALITY < 3:
# DIAGNOSIS='mild'
# elif MENTALITY > 5 and mentality < 10:
# DIAGNOSIS='notice me notice me type,'
# elif MENTALITY > 10 and MENTALITY <= 20:
# DIAGNOSIS='jack hoffish and almost k00nt like'
# elif MENTALITY > 35 and MENTALITY < 50:
# DIAGNOSIS='almost twitter/facbook/google type censorship'
# elif MENTALITY >= 50:
# DIAGNOSIS='semi-stalkerish, you know... probably have not even received their actual valentine card yet. definitely got lost in the mail im sure but hey, show on this teddy bear where this artwork hurts you kind of'
# MSG="<< done with some {} interruptions >>".format(DIAGNOSIS)
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
if self._ST8 == 6:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< someone or something is inihibiting the operations, we may not finish the op >>"
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 6:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MSG="<< someone or something is inihibiting the operations, we may not finish the op >>"
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
if self._ST8 == 7:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< im now offended and attacking the source of the problems, probably not gonna go well >>"
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 7:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MSG="<< im now offended and attacking the source of the problems, probably not gonna go well >>"
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
if self._ST8 == 8:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< finshed the op but people are definitely gonna be pissed >>"
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 8:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MSG="<< finshed the op but people are definitely gonna be pissed >>"
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
if self._ST8 == 9:
for i,B0T.nick in enumerate(BOTNICKS):
if BOTNICKS[i] == B0T.nick:
MSG="<< being shunted by forces of an administration access. failsafed and self-shutting down >>"
#redundant code//change later
MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
self.context.privmsg(CHN,MSG)
# if self._ST8 == 9:
# for i,B0T.nick in enumerate(BOTNICKS):
# if BOTNICKS[i] == B0T.nick:
# MSG="<< being shunted by forces of an administration access. failsafed and self-shutting down >>"
# #redundant code//change later
# MSG+="(BOT)NICK/NAME:{}/{} <>".format(BOTNICKS[i],BOTNAMES[i])
# MSG+="LOCK:{} READ:{} WRITE:{}".format(self._kbl[B1N],self._kbr[B1N],self._kbw[B1N])
# MSG+="LINES:{} INDEX:{} INTERRUPTED:{}".format(self._fli,self._fin,self._int)
# self.context.privmsg(CHN,MSG)
# """

1
run.sh
View File

@ -80,6 +80,7 @@ if [ $INIT -eq 0 ]; then
kwrite " irc3.plugins.cron"
kwrite " irc3.plugins.logger"
kwrite " irc3.plugins.userlist"
kwrite " plugins.b33p"
kwrite " plugins.krylon"
kblank
kwrite "flood_burst = 0"