Help with If and PixelSearch

Post gaming related scripts
Traurig

Help with If and PixelSearch

06 Jan 2018, 07:56

Hi folks!

So I'm stumped. Here's roughly what I want to happen, all at the same time.

1. AHK refreshes in-game trader inventory (one click)
2. AHK scrolls through inventory (one click every ~800ms to allow for PixelSearch to properly function)
3. AHK interrupts normal loop (scrolling through inventory, refreshing inventory) when it notices pixel of certain color as defined by PixelSearch
4. Upon noticing, starts new routine to click pixel (item), click another two buttons to confirm sale
5. Once sale is complete, return to previous loop and start at step 1.

Hopefully that's clear enough. Here's my code. I have a feeling that certain things are looping and PixelSearch is being ignored in favor of the "Else" section of the expression. I just can't wrap my head around the logic unfortunately. Any help appreciated!

As of right now, the loop just scrolls through (and refreshes) the trader inventory (the 'Else' portion of the code). It does not seem to be paying any attention to the persistent (my goal) pixel searching.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
Xtra
Posts: 1063
Joined: 02 Oct 2015, 12:15

Re: Help with If and PixelSearch

06 Jan 2018, 15:25

The else portion of your script needs to be in a code block using { }

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Gaming”

Who is online

Users browsing this forum: Player and 8 guests