diff --git a/default.nix b/default.nix index 0c62b03..7db2cc9 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,7 @@ }: buildNimPackage (finalAttrs: { pname = "webfisher"; - version = "0.2.0"; + version = "0.2.1"; src = ./.; diff --git a/src/webfisher/meta.nim b/src/webfisher/meta.nim index 9e79adf..8a3a4e7 100644 --- a/src/webfisher/meta.nim +++ b/src/webfisher/meta.nim @@ -1,3 +1,3 @@ let - releaseVersion* = "0.2.0" + releaseVersion* = "0.2.1" diff --git a/src/webfisher/screen.nim b/src/webfisher/screen.nim index c16dc89..54d4589 100644 --- a/src/webfisher/screen.nim +++ b/src/webfisher/screen.nim @@ -43,7 +43,6 @@ proc getScreenshot(): PXImage = proc getPixelColor(screenshot: PXImage; x: int; y: int): Pixel = var pixel: Pixel - pixel.color = XGetPixel(screenshot, x.cint, y.cint) pixel.r = ((pixel.color shr 16) and 0xFF).int pixel.g = ((pixel.color shr 8) and 0xFF).int @@ -61,6 +60,7 @@ proc getFishingGame*(): bool = pixel.b == reelPixel.b: # We test if at least 3 of the pixels match since the reel could block the pixel valid += 1 + discard XDestroyImage(screenshot) if valid >= 3: return true else: @@ -76,6 +76,7 @@ proc getCatchMenu*(): bool = pixel.g == menuPixel.g and pixel.b == menuPixel.b: valid += 1 + discard XDestroyImage(screenshot) if valid >= 3: return true else: diff --git a/webfisher.nimble b/webfisher.nimble index 75db3ab..ef91469 100644 --- a/webfisher.nimble +++ b/webfisher.nimble @@ -1,5 +1,5 @@ # Package -version = "0.2.0" +version = "0.2.1" author = "PassiveLemon" description = "A Nim based fishing script for Webfishing" license = "GPL-3.0-only"