-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
523 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
from JoycontrolPlugin import JoycontrolPlugin | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class AutoRaid(JoycontrolPlugin): | ||
async def run(self): | ||
logger.info('Auto Raid Plugin loaded!') | ||
|
||
while True: | ||
await self.button_push('a') # Select the "Fight" button | ||
await self.wait(0.1) | ||
await self.button_push('up') | ||
await self.wait(0.3) | ||
await self.button_push('a') # Select the "Next" button | ||
await self.wait(0.1) | ||
await self.button_push('a') | ||
await self.wait(0.3) | ||
await self.button_push('a') | ||
await self.wait(0.1) | ||
await self.button_push('up', press_time_sec=3.0) | ||
await self.wait(0.3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import logging | ||
import datetime | ||
from JoycontrolPlugin import JoycontrolPlugin, JoycontrolPluginError | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class CombineHoneyAndCandy(JoycontrolPlugin): | ||
def __init__(self, controller_state, options): | ||
super().__init__(controller_state, options) | ||
|
||
if options is None or len(options) < 2: | ||
raise JoycontrolPluginError('Plugin option not set. Please use "--plugin-options <honey_num> <rare_candy_num>".') | ||
|
||
self.honey_num = int(options[0]) | ||
self.rare_candy_num = int(options[1]) | ||
|
||
|
||
async def combine_items_3honey_1candy(self): | ||
await self.button_push('a') | ||
await self.wait(0.3) | ||
await self.button_push('a') # Combine items | ||
await self.wait(0.3) | ||
await self.button_push('a') | ||
await self.wait(2.0) | ||
await self.button_push('a') | ||
await self.wait(3.0) | ||
|
||
await self.button_push('right') # Go to the "Honey" | ||
await self.wait(0.5) | ||
|
||
# Select three berries | ||
await self.button_push('a') | ||
await self.wait(0.3) | ||
await self.button_push('a') | ||
await self.wait(0.3) | ||
await self.button_push('a') | ||
await self.wait(0.3) | ||
|
||
await self.button_push('left') # Go to the "Rare Candy" | ||
await self.wait(0.5) | ||
|
||
# Select a candy | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
|
||
await self.button_push('a') # Yes | ||
await self.wait(1.5) | ||
|
||
# Close messages | ||
await self.button_push('a') | ||
await self.wait(1.5) | ||
|
||
await self.button_push('a') | ||
await self.wait(5.0) | ||
|
||
await self.button_push('a') | ||
await self.wait(5.0) | ||
|
||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
|
||
|
||
def __calc_total_count(self, honey, rare_candy): | ||
max_honey = int(honey / 3) | ||
max_candy = rare_candy | ||
|
||
if max_honey < max_candy: | ||
return max_honey | ||
return max_candy | ||
|
||
|
||
async def combine_items(self, total): | ||
for count in range(total): | ||
await self.combine_items_3honey_1candy() | ||
logger.info(f'{count + 1}/{total} items were combined.') | ||
|
||
|
||
async def run(self): | ||
logger.info('Combine three honeys and one candy Plugin loaded!') | ||
|
||
total = self.__calc_total_count(self.honey_num, self.rare_candy_num) | ||
|
||
now = datetime.datetime.now() | ||
end_datetime = now + datetime.timedelta(seconds=total * 25) | ||
logger.info(f'Estimated end time: {end_datetime}.') | ||
|
||
await self.combine_items(total) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.abspath(os.path.dirname(__file__))) | ||
from TimeSkipBasePlugin import TimeSkipBasePlugin | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class BuyBargains(TimeSkipBasePlugin): | ||
async def run(self): | ||
logger.info('Buy Bargains Plugin loaded!') | ||
|
||
lap = 1 | ||
while True: | ||
logger.info(f'buy {lap} items') | ||
lap += 1 | ||
|
||
# Talk to clerk | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
|
||
# Close the all messages | ||
for _ in range(18): | ||
await self.button_push('b') | ||
await self.wait(0.3) | ||
|
||
await self.change_year() | ||
await self.wait(1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import logging | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.abspath(os.path.dirname(__file__))) | ||
from TimeSkipBasePlugin import TimeSkipBasePlugin | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class GetBerries(TimeSkipBasePlugin): | ||
async def run(self): | ||
logger.info('Get Berries Plugin loaded!') | ||
|
||
lap = 1 | ||
while True: | ||
logger.info(f'{lap} lap') | ||
lap += 1 | ||
|
||
# Shake a tree | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
await self.button_push('a') | ||
await self.wait(0.8) | ||
|
||
# Close the all messages | ||
for _ in range(20): | ||
await self.button_push('b') | ||
await self.wait(0.3) | ||
|
||
await self.change_year() | ||
await self.wait(1.0) |
Oops, something went wrong.