Exemplo n.º 1
0
    item_two = 'templates/c_harra.bmp'
    bank = 'templates/use_bank_chest.bmp'

    bank_coords = [
        965,
        490,
    ]
    preset_key = '2'

    tasks = [
        HotKeyTask(preset_key, positives=['templates/bank.bmp']),
        HotKeyTask('space', positives=[
            'templates/mix.bmp',
        ]),
        SequenceTask([
            ClickTask(
                bank, negatives=[item_two], threshold=10, coords=(-1, -1)),
            ClickTask(item_two),
            ClickTask(item_one),
        ],
                     negatives=[
                         'templates/cancel.bmp', 'templates/mix.bmp',
                         'templates/bank.bmp'
                     ],
                     threshold=0),
        HoverLoc(
            bank_coords[0],
            bank_coords[1],
            negatives=[bank, item_two],
        ),
        # RngMouseMove(mst=6000, gst=12000),
    ]
Exemplo n.º 2
0
import cv2
import pyautogui

from cvbot import base
from cvbot import utils
from cvbot.template_task import ClickTask, ScreenshotTask, SequenceTask, HotKeyTask, DragTask, StopTask, HoverLoc

import pyscreenshot as ImageGrab

from cvbot.utils import key_press, crop_image

import time

if __name__ == '__main__':
    #click anvil on finish, space bar in menu, click anvil if no heat bar?

    tasks = [
        StopTask(positives=['templates/smelting_oom.bmp']),
        ClickTask('templates/smelt_furnace.bmp',
                  negatives=['templates/cancel.bmp'],
                  coords=(-1, -1)),
        HotKeyTask('space',
                   positives=[
                       'templates/begin_project_bar.bmp',
                   ],
                   negatives=['templates/empty_bar.bmp']),
        HoverLoc(x=965, y=460, negatives=['templates/cancel.bmp']),
    ]

    base.Bot(tasks, cycle_delay=0, minutes=2400).main()
Exemplo n.º 3
0
logger = utils.get_logger()

if __name__ == "__main__":
    base_directory = "templates/lost_ark_market"
    bid_buy_button = f"{base_directory}/bid_buy_button.bmp"
    bid_now_button = f"{base_directory}/bid_now_button.bmp"
    min_bid_1 = f"{base_directory}/min_bid_1.bmp"
    ok_button = f"{base_directory}/ok_button.bmp"
    select_row = f"{base_directory}/select_row.bmp"
    next_page_button = f"{base_directory}/next_page_button.bmp"

    # have trade menu open and filtered and sorted 
    tasks = [
        HotKeyTask('escape', negatives=[min_bid_1], positives=[bid_now_button]),
        ClickTask(bid_now_button, positives=[min_bid_1]),
        HotKeyTask('enter', positives=[ok_button]),
        SequenceTask([
            ClickTask(select_row, negatives=[bid_now_button], threshold=3),
            ClickTask(bid_buy_button, positives=[select_row], threshold=3),
        ], positives=[select_row], threshold=2),
        
        ClickTask(next_page_button, negatives=[select_row])
    ]

    # tasks = [        
        
        
        
    #     ClickTask(next_page_button, negatives=[select_row], threshold=1),
Exemplo n.º 4
0
    relevant_screen = ((0, 1080), (600, 1700))


if __name__ == '__main__':
    herb = 'dweed'
    bank_preset = '2'
    taskbar_slot = '2'

    clean_template = 'templates/c_{}.bmp'.format(herb)
    grimy_template = 'templates/g_{}.bmp'.format(herb)

    tasks = [
        ClickTask(template=None,
                  positives=[clean_template, 'templates/use_bank_chest.bmp'],
                  negatives=[
                      'templates/bank.bmp', grimy_template,
                      'templates/cancel.bmp'
                  ],
                  threshold=3,
                  coords=(-1, -1)),
        HotKeyTask(bank_preset, n_presses=1, positives=['templates/bank.bmp']),
        HotKeyTask(taskbar_slot,
                   n_presses=1,
                   positives=[grimy_template],
                   negatives=['templates/cancel.bmp', 'templates/bank.bmp'],
                   threshold=3),
        HotKeyTask('space',
                   n_presses=1,
                   positives=['templates/clean_button.bmp']),
        HoverLoc(x=965,
                 y=460,
                 negatives=[grimy_template],
Exemplo n.º 5
0
from cvbot.template_task import ClickTask, ScreenshotTask, SequenceTask, HotKeyTask, DragTask, StopTask, HoverTask

import pyscreenshot as ImageGrab

from cvbot.utils import key_press, crop_image

import time

if __name__ == '__main__':
    #click anvil on finish, space bar in menu, click anvil if no heat bar?

    tasks = [
        StopTask(positives=['templates/smelting_oom.bmp']),
        SequenceTask([
            #ClickTask('templates/banker.bmp', coords=(-1, -1)),
            ClickTask('templates/use_bank_chest.bmp', coords=(-1, -1)),
            HotKeyTask('2', positives=['templates/bank.bmp']),
            ClickTask('templates/smelt_furnace.bmp', coords=(-1, -1)),
            HotKeyTask('space', positives=['templates/begin_project_bar.bmp']),
        ]),
        HoverTask([(12, 180, 249), (24, 78, 121)],
                  threshold=10,
                  positives=[
                      'templates/diamond.bmp',
                  ],
                  negatives=[
                      'templates/cancel.bmp',
                  ]),
        HoverTask([
            (25, 170, 129),
            (22, 119, 92),
Exemplo n.º 6
0
from cvbot import base
from cvbot import utils
from cvbot.template_task import ClickTask, HotKeyTask, SequenceTask
from cvbot.utils import gen_hsv, crop_array

logger = utils.get_logger()

if __name__ == "__main__":
    base_directory = "templates/lost_ark_market"
    select_all = f"{base_directory}/select_all.bmp"
    take_button = f"{base_directory}/take_button.bmp"
    remove_button = f"{base_directory}/remove_button.bmp"
    chest = f"{base_directory}/chest.bmp"
    envelop = f"{base_directory}/envelop.bmp"
    yes_button = f"{base_directory}/yes_button.bmp"

    tasks = [
        ClickTask(yes_button),
        ClickTask(select_all, threshold=1.5),
        ClickTask(take_button, positives=[chest]),
        ClickTask(remove_button, positives=[envelop], negatives=[chest]),
    ]

    base.Bot(tasks, cycle_delay=.25, minutes=60).main()
Exemplo n.º 7
0
    #     HotKeyTask('4', n_presses=1, positives=['templates/bowstring.bmp', ], negatives=['templates/cancel.bmp']),
    #     HotKeyTask('space', positives=['templates/fletch_button.bmp', ]),
    #
    #     HoverLoc(x=965, y=460, negatives=['templates/bowstring.bmp'], threshold=60),
    #     # HoverTask( [(0, 11, 238), (178, 14, 226), (0, 0, 255), (5, 15, 206), (13, 155, 143)],
    #     #           threshold=10, negatives=['templates/bowstring.bmp', 'templates/banker.bmp' ])
    # ]

    tasks = [
        # RngMouseMove(),
        # StopTask(positives=['templates/smelting_oom.bmp']),
        # WaitTask(threshold=0, positives=['templates/g_dweed.bmp', 'templates/cancel.bmp']),
        ClickTask(template=None,
                  positives=[
                      'templates/c_dweed.bmp', 'templates/use_bank_chest.bmp'
                  ],
                  negatives=['templates/bank.bmp', 'templates/g_dweed.bmp'],
                  threshold=3,
                  coords=(-1, -1)),
        HotKeyTask('2', n_presses=1, positives=['templates/bank.bmp']),
        HotKeyTask('2',
                   n_presses=1,
                   positives=['templates/g_dweed.bmp'],
                   negatives=['templates/cancel.bmp']),
        HotKeyTask('space',
                   n_presses=1,
                   positives=['templates/clean_button.bmp']),
        HoverLoc(x=965,
                 y=460,
                 negatives=['templates/g_dweed.bmp'],
                 positives=['templates/c_dweed.bmp'],
Exemplo n.º 8
0
 # HotKeyTask('1', positives=['templates/fetch_menu.bmp']),
 #
 # # SequenceTask([
 #
 # # ], negatives=['templates/mahogany_plank.bmp']),
 #
 # HoverBuild(x=970, y=297, main_template='templates/mahogany_plank.bmp',
 #            negatives=['templates/build.bmp', 'templates/interact.bmp', 'templates/remove.bmp']),
 # HoverTask([(0, 0, 0), (6, 215, 127), (5, 181, 135)],
 #           threshold=20, negatives=['templates/mahogany_plank.bmp',
 #                                    'templates/talk_dbutler.bmp', 'templates/fetch.bmp', 'templates/fetch_menu.bmp']),
 #
 #
 #
 HotKeyTask('1', positives=['templates/build_menu_teak.bmp']),
 ClickTask('templates/remove_teak.bmp', ),
 ClickBuild('templates/build.bmp',
            coords=(-1, -1),
            main_template='templates/teak_plank.bmp'),
 ClickTask('templates/interact_teak.bmp',
           coords=(-1, -1),
           button='right'),
 ClickTask('templates/talk_dbutler.bmp',
           coords=(-1, -1),
           button='right',
           threshold=15,
           negatives=[
               'templates/fetch.bmp', 'templates/fetch_menu.bmp',
               'templates/teak_plank.bmp'
           ]),
 ClickTask('templates/fetch.bmp', ),
Exemplo n.º 9
0
        'play_again.bmp',
        'ok_pink_button.bmp', 'new_story_button.bmp',
        'no_voice_button.bmp',
        'rolling.bmp',
        'skip_faded.bmp',
        'next_button.bmp'
    ]
    button_templates = priority_tasks + [
        x for x in button_templates if x not in priority_tasks
    ]

    sequence_prefix = 'templates/bandori/sequence/'

    sequence_setup = [SequenceTask(
        [
        ClickTask(sequence_prefix+'game_icon.bmp'),
         ClickTask(sequence_prefix+'check_box.bmp'), ClickTask(sequence_prefix+'agree_button.bmp'),
          ClickTask(sequence_prefix+'area_story.bmp'),
         ClickTask(sequence_prefix+'done.bmp'),

        ClickTask(path_prefix+'cancel_button.bmp'),
         ClickTask(path_prefix+'close_grey_button.bmp'),
         ClickTask(sequence_prefix+'menu_button.bmp'), ClickTask(sequence_prefix+'data_transfer_button.bmp'),
         Transcode(sequence_prefix+'password_button.bmp'),
            ClickWait(path_prefix+'ok_pink_button.bmp'),
            ClickTask(sequence_prefix+'copy_id_button.bmp'),
         ClickTask(sequence_prefix+'close.bmp'),

        ClickTask(path_prefix + 'close_grey_button.bmp'),

         ClickTask(sequence_prefix+'presents.bmp'), ClickTask(sequence_prefix+'present_accept.bmp'),
Exemplo n.º 10
0
        if len(utils.match_template(img, self.main_template)[0]) < 8 * 2:
            return False
        return super()._active(img)

class ClickBuild(ClickTask):
    def _active(self, img):
        # print(len(utils.match_template(img, self.main_template)[0]))
        if len(utils.match_template(img, self.main_template)[0]) < 8 * 2:
            return False
        return super()._active(img)

if __name__ == '__main__':
    #stand next to wall, build above, zoom in angle up

    tasks = [
        ClickTask('templates/talk_simon.bmp', coords=(-1, -1), button='right',
                  negatives=['templates/dragon_bones.bmp']),
        ClickTask('templates/pray_chaos_altar.bmp', coords=(-1, -1), button='right',
                  positives=['templates/dragon_bones.bmp'], negatives=['templates/prayer.bmp']),



        ClickTask('templates/bank_simon.bmp', ),


        ClickTask('templates/offer_chaos_altar.bmp', ),

        HotKeyTask('1', positives=['templates/bank.bmp']),

        HoverTask([(162, 65, 51),
                   (160, 66, 85),
                   (102, 21, 209),