From 198d7a7cbef86d076052c142142d6ae4a87b1bfb Mon Sep 17 00:00:00 2001 From: Jeffrey Tan Date: Sat, 25 Dec 2021 00:13:36 -0800 Subject: [PATCH] added mana balance and redid cf1 for kanna --- capture.py | 2 +- command_books/kanna.py | 22 ++++++++++++++++---- config.py | 2 +- layouts/cf1 | Bin 0 -> 1312 bytes routines/cf1.csv | 38 ++++++++++++++++++++++++++++++++++ routines/inactive/cf1_384.csv | 13 ------------ 6 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 layouts/cf1 create mode 100644 routines/cf1.csv delete mode 100644 routines/inactive/cf1_384.csv diff --git a/capture.py b/capture.py index e4053a6b..582808fe 100644 --- a/capture.py +++ b/capture.py @@ -61,7 +61,7 @@ def _main(): # Check for unexpected black screen regardless of whether bot is enabled gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) - if not config.alert_active \ + if config.enabled and not config.alert_active \ and np.count_nonzero(gray < 15) / height / width > 0.95: config.alert_active = True config.enabled = False diff --git a/command_books/kanna.py b/command_books/kanna.py index e97e6235..fcbf83c8 100644 --- a/command_books/kanna.py +++ b/command_books/kanna.py @@ -114,10 +114,11 @@ def __init__(self): self.buff_time = 0 def main(self): - buffs = ['f1', 'f2', 'f4'] + buffs = ['f1'] now = time.time() if self.haku_time == 0 or now - self.haku_time > 490: - press('ctrl', 2) + press('f4', 2) + press('f3', 2) self.haku_time = now if self.buff_time == 0 or now - self.buff_time > config.buff_cooldown: for key in buffs: @@ -174,7 +175,10 @@ def main(self): for _ in range(self.repetitions): press('r', self.attacks, up_time=0.05) key_up(self.direction) - time.sleep(0.2) + if self.attacks > 2: + time.sleep(0.3) + else: + time.sleep(0.2) class Tengu(Command): @@ -231,7 +235,7 @@ def __init__(self): self.name = 'Kishin' def main(self): - press('lshift', 4, down_time=0.1, up_time=0.15) + press('ctrl', 4, down_time=0.1, up_time=0.15) class NineTails(Command): @@ -295,3 +299,13 @@ def __init__(self): def main(self): press('c', 2) + + +class Balance(Command): + """Restores mana using 'Mana Balance' once.""" + + def __init__(self): + self.name = 'Mana Balance' + + def main(self): + press('lshift', 4) diff --git a/config.py b/config.py index 6c3cacc8..8bdff4b5 100644 --- a/config.py +++ b/config.py @@ -96,4 +96,4 @@ record_layout = False # The amount of time (in seconds) to wait between each call to the 'buff' command -buff_cooldown = 250 +buff_cooldown = 180 diff --git a/layouts/cf1 b/layouts/cf1 new file mode 100644 index 0000000000000000000000000000000000000000..02c3ce6c5c644a5bdd350e6e834cbda1de67a285 GIT binary patch literal 1312 zcmZ{kJxmi}7{`l63Pn`3S`|etezd4q{HkBHE`+7Ih2?b70);cdo)77%Bs__RjjbD- zn-j)CVf#+5o+c@K1_8&7GkQ8>otPCM-4rh zKgq(=mEI5zMk(Brc{#Njc|Bd$LxQkwUmwm77OByY%1um7aYJZ+rmp@?jNdT?U5-u4 z4?_`~nYMsfnz-?GXy#Ehv6ZPA#HZYpQ0rPG_RTI_puydf|?9!}0BdQsAs-U}>_8{nI)u8o3;oQQs z7to??St+|7(%hgkbSx2#?AAMw^}G%8DQhnbFmo0X$(T9Diu=@6T=*WoBr9K;7X z>#5ahBEi%S;;k$$-R&X#%2T~N#&jIgc_@?qQrQk{2 z4Vyjgfk1RJodU5esveujc?iFx?U{%@Q@NaGI)flT)|S@I1vY1y&Vf*^L4hveW8;QT zF`b9F;;#NzEEKAr7nm+WVgC_iRqpNf*r_$S#B>?_oSb;-n&h9OmYKC?b}^*^Er{VJ m3(q9<0&5s^cFDeV?vOG}S0Jgl6HlDKOl2OjR&j5wzK(yS@yK!j literal 0 HcmV?d00001 diff --git a/routines/cf1.csv b/routines/cf1.csv new file mode 100644 index 00000000..f4d9c7f7 --- /dev/null +++ b/routines/cf1.csv @@ -0,0 +1,38 @@ +s, record_layout, True + + +*, 0.811, 0.243, frequency=15 + kishin +*, 0.415, 0.243, frequency=5 + yaksha, direction=right +*, 0.150, 0.243, frequency=15 + shikigami, direction=left, attacks=3 +*, 0.275, 0.142 + shikigami, direction=left, attacks=3 + shikigami, direction=right, attacks=3 + wait, 0.05 +*, 0.275, 0.142, adjust=True + exorcist + wait, 0.3 + teleport, direction=up, jump=False + shikigami, direction=right, attacks=3 + shikigami, direction=right + teleport, direction=down, jump=False + wait, 0.05 +*, 0.125, 0.142, counter=1, frequency=15 + yaksha, direction=right + balance +*, 0.275, 0.142, counter=1, frequency=15 + teleport, direction=up + shikigami, direction=left, attacks=3 + teleport, direction=right + shikigami, direction=right, attacks=3 + shikigami, direction=right + teleport, direction=down +*, 0.640, 0.108, counter=1, frequency=15, adjust=True + shikigami, direction=left + shikigami, direction=right +*, 0.640, 0.108, counter=1, frequency=15 + exorcist + wait, 0.2 +*, 0.640, 0.243, counter=1, frequency=15 diff --git a/routines/inactive/cf1_384.csv b/routines/inactive/cf1_384.csv deleted file mode 100644 index 46d1b9bb..00000000 --- a/routines/inactive/cf1_384.csv +++ /dev/null @@ -1,13 +0,0 @@ -tengu_on=False -0.900;0.685;frequency=15;attacks=0;extras=['kishin'] -0.415;0.685;frequency=5;attacks=0;extras=["boss('right')"] -0.150;0.685;frequency=15 -0.275;0.407;frequency=5;attacks=0;extras=['exo','wait(1.2)'] -0.275;0.407 -0.275;0.407;attacks=0;extras=['exo',"teleport('up',jump=False)","shikigami('right')","teleport('down',jump=False)",'wait(0.3)'] -#0.415;0.685;counter=1;frequency=15;attacks=0;extras=["boss('right')"] -#0.275;0.407;counter=1;frequency=15;attacks=0;extras=["teleport('up')","shikigami('left')","teleport('right')","shikigami('right')","teleport('down')"] -0.125;0.407;counter=1;frequency=15;attacks=0;extras=["boss('right')"] -0.275;0.407;counter=1;frequency=15;attacks=0;extras=['exo'] -0.640;0.350;counter=1;frequency=15 -0.640;0.350;counter=1;frequency=15;attacks=0;extras=['exo','wait(0.2)'] \ No newline at end of file