Jump to content

pixelsearhch, do.. until...


mrtgtr
 Share

Recommended Posts

True, got it. My apologies mods.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

thanx I will try now,

5 is color tolerance at pixelsearch

7 is color tolerance at pixelgetcolor, same thing

 

it did not do good again press c contuniusly,likewise.

but I fixed my problem like this

Func OTUR()
PixelSearch(976, 140, 990, 147, 0x000000,5)
PixelSearch(976, 193, 990, 199, 0x000000,5)
PixelSearch(976, 245, 990, 252, 0x000000,5)
PixelSearch(976, 296, 990, 303, 0x000000,5)
PixelSearch(976, 349, 990, 356, 0x000000,5)
PixelSearch(976, 402, 990, 409, 0x000000,5)
PixelSearch(976, 453, 990, 460, 0x000000,5)
PixelSearch(976, 505, 990, 512, 0x000000,5)
If @error Then
   Sleep(50)
   Send("{c down}")
   Sleep(50)
   Send("{c up}")
Do
   Sleep(100)
PixelSearch(976, 140, 990, 147, 0x000000,5)
PixelSearch(976, 193, 990, 199, 0x000000,5)
PixelSearch(976, 245, 990, 252, 0x000000,5)
PixelSearch(976, 296, 990, 303, 0x000000,5)
PixelSearch(976, 349, 990, 356, 0x000000,5)
PixelSearch(976, 402, 990, 409, 0x000000,5)
PixelSearch(976, 453, 990, 460, 0x000000,5)
PixelSearch(976, 505, 990, 512, 0x000000,5)
Until Not @error
EndIf
EndFunc   ;==>OTUR

Thanx all forum.

Edited by mrtgtr
Link to comment
Share on other sites

  • Moderators

it did not do good again press c contuniusly,likewise.

but I fixed my problem like this

Func OTUR()
PixelSearch(976, 140, 990, 147, 0x000000,5)
PixelSearch(976, 193, 990, 199, 0x000000,5)
PixelSearch(976, 245, 990, 252, 0x000000,5)
PixelSearch(976, 296, 990, 303, 0x000000,5)
PixelSearch(976, 349, 990, 356, 0x000000,5)
PixelSearch(976, 402, 990, 409, 0x000000,5)
PixelSearch(976, 453, 990, 460, 0x000000,5)
PixelSearch(976, 505, 990, 512, 0x000000,5)
If @error Then
   Sleep(50)
   Send("{c down}")
   Sleep(50)
   Send("{c up}")
Do
   Sleep(100)
PixelSearch(976, 140, 990, 147, 0x000000,5)
PixelSearch(976, 193, 990, 199, 0x000000,5)
PixelSearch(976, 245, 990, 252, 0x000000,5)
PixelSearch(976, 296, 990, 303, 0x000000,5)
PixelSearch(976, 349, 990, 356, 0x000000,5)
PixelSearch(976, 402, 990, 409, 0x000000,5)
PixelSearch(976, 453, 990, 460, 0x000000,5)
PixelSearch(976, 505, 990, 512, 0x000000,5)
Until Not @error
EndIf
EndFunc   ;==>OTUR

Thanx all forum.

Your function setup is not correct.

I'll try to explain as simply as I can.  You are ONLY checking the @error of the function call before the check.  So the 7 pixelsearch functions you have done before the last one, are pointless.  You literally don't check anything more than this:

Func OTUR()
    PixelSearch(976, 505, 990, 512, 0x000000,5)
    If @error Then
       Sleep(50)
       Send("{c down}")
       Sleep(50)
       Send("{c up}")
        Do
            Sleep(100)
            PixelSearch(976, 505, 990, 512, 0x000000,5)
        Until Not @error
    EndIf
EndFunc   ;==>OTUR

The way you have your code setup.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Your function setup is not correct.

I'll try to explain as simply as I can.  You are ONLY checking the @error of the function call before the check.  So the 7 pixelsearch functions you have done before the last one, are pointless.  You literally don't check anything more than this:

Func OTUR()
    PixelSearch(976, 505, 990, 512, 0x000000,5)
    If @error Then
       Sleep(50)
       Send("{c down}")
       Sleep(50)
       Send("{c up}")
        Do
            Sleep(100)
            PixelSearch(976, 505, 990, 512, 0x000000,5)
        Until Not @error
    EndIf
EndFunc   ;==>OTUR

The way you have your code setup.

 
does not solve because there are black and red pixels at between my pixelsearch cordinates, they make me wrong process
Edited by mrtgtr
Link to comment
Share on other sites

  • Moderators

I didn't try to solve anything, I was pointing out your mistake.  You've exhausted my interest in helping by ignoring previous points.  Good luck to you.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I use pixelsearch however I am more fond of pixelgetcolor. PixelSearch starts on the top left corner of the x1,y1 coords and checks the color then it goes to x1, y1+1 and checks and then x1,y1+2 etc until it gets to the end of the search x axis then it goes to x2,y1 and so on. The 52 was approximately what he was doing in his first post. I am skipping 52 pixels and it is looping on the x axis which is 1 pixel high. If I say step 52 pixels it will process as search x1,y1 then look for the color then look at x1,y53 (maybe y52 but I dont think so).

You are aware PixelSearch can go in whatever direction you choose?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Why did not you used variables for each pixel search methode? I am kinda beginer on AutoIT but, for me your code is a bit sily.

I did take a look on it, and i also end up with the same answare as SmOke_N.

You checking the pixel color on a small area several times, but if you thinking logic, the program always rewrite the previous value with the new. I say, it is better to give different wariable for all search line, then you can easily identify and separate them from each other. Your code will be accured. ;-)

Also will be a lots of help for us, if you give is more info where you wana use your code, cause there are several other methode what we can "make" help to you to make your code much more effective. If you useing on window, as you do, you can use window handle, then you can fix some problem with it, insted of, just writeing short code, what will have some serious problem, or work only on specific situation.

Do not get me wrong, just try to help.

Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Link to comment
Share on other sites

You are aware PixelSearch can go in whatever direction you choose?

I didnt see how to do this in the online reference but I see it in the remarks section. I still don't understand how to do it though.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

PixelSearch(@desktopwidth, @desktopheight, 0, 0, 0)

Will search screen for a black pixel, it will search from bottom right to top left.

I still don't understand why. What part of this controls the direction of the pixelsearch?

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

Yes, if the left parameter is greater than the right, then the search will go from right to left.

If the top parameter is greater than the bottom parameter the search will go from bottom to top.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

does not solve because there are black and red pixels at between my pixelsearch cordinates, they make me wrong process

 

 

 

Searching to exclude black and red pixels because they make his program go to a wrong function?

 

Poker bot anyone?

Also will be a lots of help for us, if you give is more info where you wana use your code, cause there are several other methode what we can "make" help to you to make your code much more effective.

 

 

His prior posts were locked because he was interacting with a game.  Which is why he will be as vague as possible.  Which is also why no one should help him.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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...