Jump to content

pixel search ?


Recommended Posts

what i got so far.

Sleep (5000)
Send("L")
Sleep (1000)
MouseClick("left")
Sleep (1000)
$coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
While @error = 0

basicly im stuck and ive been all over this site trying to figure out what goes next. all im trying to do is hit 'L' to ready fishing, then mouse click to cast (which all works), then use the pixelsearch to detect blue, when blue i need to hold down spacebar, when it turns red, i need to release it, , then when blue do same thing so it alternates and knows instantly. ive seen soo many types of examples i've tried some but just dont think im even putting things in correctly. could anyone help me with a small example? ty

Link to comment
Share on other sites

I donno if this will work im just guessing, Im not shur how to hold a key down for an extended period of time and still actually only press it once. If anyone else knows this, I would like to know as well.

Sleep (5000)
Send("L")
Sleep (1000)
MouseClick("left")
Sleep (1000)

While 1
    $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
    If @error = 0 Then
        Opt("SendKeyDownDelay", 300000) ;will hold Space down for 5 min or until pixelcolor changes ??
        Send("{SPACE}")
        While 1
            $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
            If @error = 1 Then
                Opt("SendKeyDownDelay", 5)
                Send("{SPACE}")
                ExitLoop
            eNDiF
        Wend
    EndIf
Wend

I guess the question is, Will a second press of the Space bar release the first?

Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

ok Thanks Richard, I was under the False impression that only worked for keys like ALT, CTRL, etc .

Sleep (5000)
Send("L")
Sleep (1000)
MouseClick("left")
Sleep (1000)

While 1
    $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
    If @error = 0 Then
        Send("{SPACE DOWN}")
        While 1
            $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
            If @error = 1 Then
                Send("{SPACE UP}")
                ExitLoop
            eNDiF
        Wend
    EndIf
Wend

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

WinActivate ( "2Moons" )
WinWaitActive ( "2Moons" )

Sleep (5000)
Send ("L")
Sleep (1000)
Send ("L")
Sleep (1000)
MouseClick ("left")
Sleep (1000)

While 1
    $coor = PixelSearch( 33, 91, 98, 102, 0x327BB4, 200, 2 )
    If @error = 0 Then
        Send("{SPACE DOWN}")
        While 1
            $coor = PixelSearch( 33, 91, 98, 102, 0xDF080D, 200, 2 )
            If @error = 1 Then
                Send("{SPACE UP}")
                ExitLoop
            eNDiF
        Wend
    EndIf
Wend

hmm i cant seem to get it to work. ive tried many many other hex numbers and changed the shade-variation to 200 but still even with a small rectangle for my pixelsearch its not finding the color strange.

example: Posted Image

This example basicly shows everything it does. As you notice the bar has many different color shades of blue and red.

Edited by bigworm
Link to comment
Share on other sites

Without haveing the program installed myself for testing I cant really be shur of the problem, But the first thing I would do is make sure your Basic Pixelsearch command is working and the CoOrds you are useing are correct.

Sleep(2000)


$CoOrds = PixelSearch( 1300, 50, 1320, 60, 16711323)

Msgbox(0," 1 = Cannot Find color in area, 0 = Found", @Error)

soething simple like this, test for a Positve result and a negative result

Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

i dont know if its right but, i used the window viewer that comes with autoit and thats where i got the coords from and the hex colors. hmm lol i knew this was gunna be tough but gotta learn it somehow. im trying that script above to see if it checks it.

Edited by bigworm
Link to comment
Share on other sites

wow i did have the wrong cords. thanks for that script for showing me if it would read it or not offlight. that works i got the right cords and it pressed spacebar when blue and released on red. now the only thing i need to do is have it continue over and over. now also is there a way so that if it dont detect a color with in 20 secs then it would redo the casting steps? and then if it detects then it goes thru its realin them in steps?

Edited by bigworm
Link to comment
Share on other sites

that works i got the right cords and it pressed spacebar when blue and released on red. now the only thing i need to do is have it continue over and over.

As it is written so far as soon as it doesnt see Blue anymore it will exit the 2nd loop, at that point it should still be within the First loop and continually look for the blue.

If I remember correctly this is the correct implementation for checking for the 20sec delay you wanted. If not it atleast shows the function to look at in the help file.

WinActivate ( "2Moons" )
WinWaitActive ( "2Moons" )

While 1
    Sleep (5000)
    Send ("L")
    Sleep (1000)
    Send ("L")
    Sleep (1000)
    MouseClick ("left")
    Sleep (1000)
    $begin = TimerInit()

    While 1
        $dif = TimerDiff($begin)
        If $dif > 20000 Then Exitloop
        
        $coor = PixelSearch( 33, 91, 98, 102, 0x327BB4, 200, 2 )
        If @error = 0 Then
            Send("{SPACE DOWN}")
            While 1
                $coor = PixelSearch( 33, 91, 98, 102, 0xDF080D, 200, 2 )
                If @error = 1 Then
                    Send("{SPACE UP}")
                    ExitLoop
                eNDiF
            Wend
        EndIf
    Wend
Wend

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

i think is ee the problem. if you look at my photoshop of the bar you'll notice when the bar turns blue theres a blue top and with the cords i got now it views both bars, im gunna have to get a really exact cord for just the lower bar. cus i think its pressing spacebar the whole time cus it views blue the whole time.

seems maybe the color is off a little cus the color i put up there it isnt picking it up fast enough for higher level fishing. takes a sec then it hits spacebar.

Edited by bigworm
Link to comment
Share on other sites

Does the bar appear in the same place on the screen every time?

If so, you are greatly over complicating your life using PixelSearch.

Try Using Pixelgetcolor()

Its much faster, and can be ore accurate too.

Link to comment
Share on other sites

:) umm yes it does, on the screen fist bar comes up and then once fish is caugh the blue bars pop up. god the funs of being new to something. ty for posting and throwing that out there. i'll see what i can put together now.
Link to comment
Share on other sites

I installed 2moons to mess around with and come to find out, it has an anti-hack program that prevents AutoIt from detecting pixelcolor. The game is however DX9 so you can use VMWare6 to subvert this.

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

yea i took screenshots to get my colors, but then it was hard to get exact cords after that. ill check out vnware6, ive never used it before but thanx for the heads up. i dont even know also if the screenshot works effectively, i just gave it a shot.

Edited by bigworm
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...