diff --git a/README.md b/README.md index 2620aa0..9033242 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# .[d]. ircd.chat/6697 #tcpdirect +# .[d]. ircd.chat/6697 #tcpdirect ``` MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMh+MMMMMMMMMMMMMMhsMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM @@ -35,7 +35,13 @@ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdyymMMMMMMMMMMMMMMMMMMMMMMMMMMM ``` ## summary ``` -dr1p4ns1 v2.3 - cp437 ansi parser +dr1p4ns1 v2.6 - cp437 ansi parser +``` +## changelog - v2.6 +``` +- ! added a floodrate delay interval for servers like efnet, press d to set the delay interval +- ? the delay option waits x seconds between each line sent to a server to prevent server flood kicking +- ? an interger of 0, 1, 2 or even float 0.3, 1.666 fractions are acceptable as a delay interval ``` ## screenshots ![screenshots](screenshots/ss1.jpg) @@ -59,4 +65,4 @@ ansi files can be queued so that when you pump they are being sent in a sequenti - **PUMPQUEUE:** using the q key you can queue up a bunch of ansis to pump, then just press p to fire them off. if there is nothing in the queue then whatever is on the screen will be pumped to fifo. - **FIFO:** in order to use the pump feature, you need a fifo setup in something like weechat/irsii/etc.. - if you have one setup, adjust the FIFO_PATH at the top of dr1p4ns1.py + if you have one setup, adjust the FIFO_PATH at the top of dr1p4ns1.py \ No newline at end of file diff --git a/dr1p4ns1.py b/dr1p4ns1.py index 7445550..59085e5 100644 --- a/dr1p4ns1.py +++ b/dr1p4ns1.py @@ -1,4 +1,4 @@ -########################################################################################### dr1p4ns1 version 2.3 ####### SOF +########################################################################################### dr1p4ns1 version 2.6 ####### SOF #################################################################################################### ####################### from glob import glob from time import sleep @@ -47,6 +47,7 @@ FIFO_PATH = f"{os.path.expanduser('~')}/.weechat/weechat_fifo" FIFO_ENABLED = True ##### COPY_PATH = f"{os.path.expanduser('~')}/Pictures" ##### DELETE_PATH = "/tmp" ##### +FLOODRATE_INTERVAL_SECONDS = 0.335 ##### #################################################################################################### ####################### #################################################################################################### ####################### ##### @@ -95,7 +96,12 @@ def getfiles(argv=""): print('ERROR: NO ANSI FILES IN THE PATH SPECIFIED',end='') sys.exit(1) return FILES +############################################################################################################################# +class D: + def __init__(self): + self.delay=FLOODRATE_INTERVAL_SECONDS ########################################################################################################## CLASS DR1P4NS1 - 2 + class dr1p4ns1: ############################################################################################################ LOOKUP TABLE commands = { @@ -589,6 +595,7 @@ class UI: 113: 'q', 120: 'x', 99: 'c', + 100: 'd', 82: 'R' } return key_mapping.get(k, chr(k)) @@ -609,7 +616,7 @@ class UI: while True: B='\x1b[1;94m'; C='\x1b[1;95m'; S='\x1b[1;36m'; M='\x1b[1;92m'; E='\x1b[0m'; R='\x1b[31m' msg=f"{B}[ {C}DR1P {B}] {B}- {B}[ {M}x{B}: {M}exit{B}, {M}c{B}: {M}copy{B}, {M}R{B}: {M}remove{B}, {M}q{B}: {M}pumpqueue{B}, {M}p{B}: {M}pump{B}, " - msg+=f"{M}left{B}/{M}right{B}: {M}browse {B}] {B}- " + msg+=f"{M}left{B}/{M}right{B}: {M}browse {B}] {B}- [ {M}d{B}: {M}delay{B} - {M}{dr1p.delay}{B} ]" msg+=f"{B}[ {S}pumpqueue{B}: {C}{len(self.QUEUE)} {B}- {S}index{B}: {C}{index+1}{B}/{C}{len(self.files)} {B}- {S}filename{B}: {C}{d.filename} {B}]{E}" if self.REMOVED==True: msg+=f'{R} - FILE REMOVED' print(msg) @@ -669,6 +676,28 @@ class UI: sleep(1) print('\x1bc') decoder.as_terminal() + elif k == 'd': + while True: + print(f'{C}input floodrate delay{B}: {C}',end='') + USER_INPUT=input() + TRAPFLAG=-1 + try: + TRAPFLAG=int(USER_INPUT) + except: + try: + TRAPFLAG=float(USER_INPUT) + except: + print(f'{S}accepted floodrate delay range is between 0 and 10.0 seconds') + try: + if TRAPFLAG>=0 and TRAPFLAG<=10: + dr1p.delay=TRAPFLAG + break + except: + print(f'{S}accepted floodrate delay range is between 0 and 10.0 seconds') + print(f'{M}floodrate delay set to{B}: {C}{dr1p.delay}') + sleep(1) + print('\x1bc') + decoder.as_terminal() elif k == 'p': PMSG="" try: @@ -1133,6 +1162,7 @@ class ANSIDecoder: self.as_irc_lines() for _ in self.output_lines: self.fifo(_) + sleep(dr1p.delay) ################################################################################################### RE-ENCODING ENCODINGS def as_terminal_lines(self): default_fg=7 @@ -1208,8 +1238,9 @@ class ANSIDecoder: print(_) ################################################################################################################### ENTRY - 1 if __name__=="__main__": + dr1p=D() FIFO_ENABLED = os.path.exists(FIFO_PATH) files = getfiles(sys.argv) ui = UI(files) #################################################################################################### ####################### -########################################################################################### dr1p4ns1 version 2.3 ####### EOF +########################################################################################### dr1p4ns1 version 2.6 ####### EOF \ No newline at end of file