Giter Club home page Giter Club logo

bgee_sikuli_auto_roller's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bgee_sikuli_auto_roller's Issues

Needs support for triple digit totals

First of all, thank you for the script. I used it on my MacBook to roll a 95 HE F/M.

It took a little tweaking (recaptured some of the numbers and played with the offsets a little), but I got it working.

One thing I noticed: there was no code to capture a triple digit total. The max is a 108. Without such detection, those rolls are lost!

I went ahead and added two lines to get_roll_value:

# Find total roll region
def get_roll_value():
    wait(total_roll_pattern)
    total_roll = find(total_roll_pattern)

    tens_digit_region = Region(
        int(total_roll.getTopRight().getX() - expand_pixels),
        int(total_roll.getTopRight().getY() - expand_pixels) - 1,
        digit_width + (2 * expand_pixels), 
        digit_height+ (2 * expand_pixels)
    )
    ones_digit_region = Region(
        int(total_roll.getTopRight().getX() - expand_pixels) + digit_offset_width,
        int(total_roll.getTopRight().getY() - expand_pixels) - 1,
        digit_width + (2 * expand_pixels), 
        digit_height + (2 * expand_pixels)
    )

    tens_digits = get_digits_in_region(tens_digit_region)
    ones_digits = get_digits_in_region(ones_digit_region)
    if len(tens_digits) == len(ones_digits) == 1:
        # check for triple digit total
        if tens_digits[0] == 0 or tens_digits[0] == 1:
            tens_digits[0] = 10
        roll_value = tens_digits[0] * 10 + ones_digits[0]
        return roll_value
    else:
        logging.error('Mutiple matches. tens: %s, ones: %s', tens_digits, ones_digits)
        if len(tens_digits) != 1:
            tens_digit_region.highlight(3)
        if len(ones_digits) != 1:
            ones_digit_region.highlight(3)
        return 0

I wasn't sure exactly where a triple digit score would justify (left or right), so I looked for either a zero or a one for the tens digit. I figured I'd never see a triple digit total, but just in case....

Last night I decided to roll a Half-Orc F/T. Rolled a 100 on the nose! The script stopped!! It was pretty cool. Hope this is helpful and thanks again.

Wrong path to ini file

The actual location is more like ~/Library/Containers/com.beamdog.baldursgateenhancededition/Data/Documents/Baldur's Gate - Enhanced Edition/Baldur.ini

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.