Giter Site home page Giter Site logo

Comments (4)

Siterizer avatar Siterizer commented on August 19, 2024

Yea, that's good idea, how about:
transfer this to debug mode.
In the info mode there is going to be only the first 'waiting' message

from new-world-fishing-bot.

seedlord avatar seedlord commented on August 19, 2024

I am in Info mode.
For me console output is like this:
grafik

from new-world-fishing-bot.

seedlord avatar seedlord commented on August 19, 2024

Fixed it. also added some nice logging features.
please someone create a pr? thanks in advance
grafik

changes in fishing_actions.py

...
from wrappers.logging_wrapper import info, debug
...
def reel_fish():
    reel_timeout = random_timeout(dict['fishing']['timeouts']['reeling'])
    #debug("Press mouse key for: {} s".format(reel_timeout))
    info("Reeling a fish for: {} s".format(reel_timeout))
    press_mouse_key()
    sleep(reel_timeout)
    release_mouse_key() 
... 
def pause_o():
    pause_timeout = random_timeout(dict['fishing']['timeouts']['pause'])
    debug("Pause for: {} s".format(pause_timeout))
    info("Orange Pause fishing for: {} s".format(pause_timeout))
    sleep(pause_timeout)

def pause_r():
    pause_timeout = random_timeout(dict['fishing']['timeouts']['pause'])
    debug("Pause for: {} s".format(pause_timeout))
    info("Red Pause fishing for: {} s".format(pause_timeout))
    sleep(pause_timeout)
...

changes in fishing_loops.py

...
onetimehelper = 0
...
def call_appropriate_fishing_action():
    global onetimehelper
...
    if result_from_model == '0': # 0 - model does not match any data (not fish captured yet)
        if onetimehelper == 0:
            info("Waiting for fish...")
            onetimehelper = 1
        return '0'
...
    elif result_from_model == '2': #2 - model matched the green icon (reeling a fish in)
        #info("Reeling a fish")
        reel_fish()
        return '2'
    elif result_from_model == '3': #3 - model matched the orange icon (wait x sec)
        #info("Orange Pause fishing")
        pause_o()
        return '3'
    elif result_from_model == '4': #4 - model matched the red icon (wait x sec)
        #info("Red Pause fishing")
        pause_r()
        return '4'
    elif result_from_model == '5': #5 - model did not match anything (left click, wait x sec)
        onetimehelper = 0
        info("Cast fishing rod")
        cast()
        return '5'

changes in image_recognition.py

...
            if pixel_match(color, REEL_COLOR):
                return '2'
            if pixel_match(color, WAIT_COLOR_BROWN):
                return '3'
            if pixel_match(color, WAIT_COLOR_RED):
                return '4'
    return '5'
...

from new-world-fishing-bot.

Siterizer avatar Siterizer commented on August 19, 2024

Closing dcf9e76

from new-world-fishing-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.