Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error #5

Open
hasmal95 opened this issue Jun 23, 2024 · 0 comments
Open

error #5

hasmal95 opened this issue Jun 23, 2024 · 0 comments

Comments

@hasmal95
Copy link

so i change the event codes,
also i change the color
const getActionFromCoordinates = (pullPoint, restPoint) => {
if ('#00ff00' !== getPixelColorAt(restPoint[0], restPoint[1])) {
return 'rest'
}

if ('#4b8624' !== getPixelColorAt(pullPoint[0], pullPoint[1])) {
return 'pull'

so now how i can change the resolution?

here is the dimension...

const robot = require('robotjs')

const getDimensions = (windowInstance) => {
const dimensions = windowInstance.getDimensions()
const winWidth = dimensions.right - dimensions.left
const winHeight = dimensions.bottom - dimensions.top

return {
top: dimensions.top,
bottom: dimensions.bottom,
left: dimensions.left,
right: dimensions.right,
winHeight,
winWidth,
}
}

const getTargetCoordinates = (windowInstance) => {
const {
top,
bottom,
left,
right,
winHeight,
winWidth,
} = getDimensions(windowInstance)

const yBuffer = 23;
const x = left + (winWidth / 2)
const y = top + (winHeight / 2) + yBuffer
const center = [x, y - yBuffer]

return {
pullPoint: [x, y],
restPoint: [x + 15, y],
throwPoint: [x - 100, y - 65],
fishBaitCoor: [center[0] + (center[0] * 0.375), center[1] + (center[1] * 0.15)],
center,
}
}

const getCurMouseCoor = () => {
const coor = robot.getMousePos();
return [coor.x, coor.y]
}

module.exports = {
getTargetCoordinates,
getCurMouseCoor,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant