Sign in to follow this  
Followers 0
autocomplex

Finding User Defined Color in a Specific Area of Screen

6 posts in this topic

I'm trying variotins of this ...

If $Trigger = PixelSearch ( 945, 460, 20, 20, $TriggerColor) Then
;Do Stuff
EndIf

To find a User defined color in a small area, and if it there to make several MouseMoves and MouseClicks. But it is only supposed to start when the user defined color is found.

Please Help =)

Share this post


Link to post
Share on other sites



This is the bit of code im working on ...

$Trigger = PixelSearch( 945, 460, 20, 20, $DropColor)
    If Not @error then

        ;Wield Pickaxe in #1 Inventory Slot
            MouseMove( 835, 370)
            MouseClick("left", 835, 370)

        ;Wield Pickaxe in #2 Inventory Slot
            MouseMove( 880, 370)
            MouseClick( "left" , 880, 370 )
            

        ;Wield Pickaxe in #3 Inventory Slot
            MouseMove( 925, 370)
            MouseClick( "left" , 925, 370 )

        ;Wield Pickaxe in #4 Inventory Slot
            MouseMove( 970, 370)
            MouseClick( "left" , 970, 370 )

            
        ;drop #5 inventory spot
            MouseMove( 835, 475)
            MouseClick("right", 835, 475)
            MouseMove( 835, 520)
            MouseClick( "left" , 835, 520)
            
        ;drop #6 inventory spot
            MouseMove( 880, 475)
            MouseClick("right", 880, 475)
            MouseMove( 880, 520)
            MouseClick( "left" , 880, 520)
            
        ;drop #7 inventory spot
            MouseMove( 925, 475)
            MouseClick("right", 925, 475)
            MouseMove( 925, 520)
            MouseClick( "left" , 925, 520)
            
        ;drop #8 inventory spot
            MouseMove( 970, 475)
            MouseClick("right", 970, 475)
            MouseMove( 970, 520)
            MouseClick( "left" , 970, 520)
            
    Endif

This is the error i get when i try to run it ...

post-26312-1187633239_thumb.jpg

Share this post


Link to post
Share on other sites

yes the variable is undeclared, you want it user defined then a user must specify it.. eh something like:

Global $DropColor
#include <Misc.au3>
$DropColor = _ChooseColor(1)
If Not @error then
$Trigger = PixelSearch( 945, 460, 20, 20, $DropColor)
    If Not @error then
        ;Wield Pickaxe in #1 Inventory Slot
            MouseMove( 835, 370)
            MouseClick("left", 835, 370)
        ;Wield Pickaxe in #2 Inventory Slot
            MouseMove( 880, 370)
            MouseClick( "left" , 880, 370 )
        ;Wield Pickaxe in #3 Inventory Slot
            MouseMove( 925, 370)
            MouseClick( "left" , 925, 370 )
        ;Wield Pickaxe in #4 Inventory Slot
            MouseMove( 970, 370)
            MouseClick( "left" , 970, 370 )
        ;drop #5 inventory spot
            MouseMove( 835, 475)
            MouseClick("right", 835, 475)
            MouseMove( 835, 520)
            MouseClick( "left" , 835, 520)     
        ;drop #6 inventory spot
            MouseMove( 880, 475)
            MouseClick("right", 880, 475)
            MouseMove( 880, 520)
            MouseClick( "left" , 880, 520)
        ;drop #7 inventory spot
            MouseMove( 925, 475)
            MouseClick("right", 925, 475)
            MouseMove( 925, 520)
            MouseClick( "left" , 925, 520)
        ;drop #8 inventory spot
            MouseMove( 970, 475)
            MouseClick("right", 970, 475)
            MouseMove( 970, 520)
            MouseClick( "left" , 970, 520)
    Endif
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0