Skip to content

Commit

Permalink
added mana balance and redid cf1 for kanna
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjeffreyz committed Dec 25, 2021
1 parent 52757a3 commit 198d7a7
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 19 deletions.
2 changes: 1 addition & 1 deletion capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 18 additions & 4 deletions command_books/kanna.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added layouts/cf1
Binary file not shown.
38 changes: 38 additions & 0 deletions routines/cf1.csv
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions routines/inactive/cf1_384.csv

This file was deleted.

0 comments on commit 198d7a7

Please sign in to comment.