mrabbitt / bgee_sikuli_auto_roller Goto Github PK
View Code? Open in Web Editor NEWAutomates rolling for character attributes during character creation in Baldur's Gate: Enhanced Edition
License: MIT License
Automates rolling for character attributes during character creation in Baldur's Gate: Enhanced Edition
License: MIT License
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.
The actual location is more like ~/Library/Containers/com.beamdog.baldursgateenhancededition/Data/Documents/Baldur's Gate - Enhanced Edition/Baldur.ini
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.