Jump to content

Help with pixel search


 Share

Recommended Posts

I need some help with pixel search and TimerInit

here's what i got so far:

TimerInit ()

while ( false )

$pixel = PixelSearch(0, 0, 1358, 727, 0x8B4847)

if IsArray($pixel) = True Then

MouseMove ($pixel [0], $pixel [1], 1)

EndIf

WEnd

TimerDiff ( 5000 )

its supposed to keep searching for 5 seconds or in-till it finds the pixel i'm not sure how to use TimerInit though i don't think i'm using it right i searched through the help file and these forums but i didn't find anything that could help me.I also need help with screen capture

here's what i have:

#include <ScreenCapture.au3>

_ScreenCapture_Capture(@MyDocumentsDir & "Image.jpg", 171, 256, 950, 712)

i need it to name the file differently each time my script loops so add a number after it or something but i don't know how.

and is there something that can search for a picture on the screen like pixel search but for an image?

Edited by TheKromz
Link to comment
Share on other sites

Read the help file, it's obvious you haven't even looked at the help file for TimerInit and TimerDiff. Also, while in there look at While/Wend because that code isn't right either.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

@TheKromz,

You this this a load of BS you posted and you didn't even try to run any of it.

Now go back for a couple of days and study the stuff you have been given and test with it.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I'd run the example script and examine how it works then look at the next function you want to use, run the example script for that one and examine it until you can understand what it's doing. Keep repeating until you run out of functions you want to understand.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Kroms make a simple script and work on one thing, once you understand how that works move onto something else and/or add to your existing work this is how i start all myscripts and functions:

HotKeySet("{F1}", "MyFirstFunc")
HotKeySet("{ESC}", "_Exit")
; F1 runs the script Esc closes

While 1
Sleep(10)
WEnd

Func MyFirstFunc()
;your pixel code goes here
EndFunc

Func _Exit()
Exit
EndFunc

Once you have a working pixel code and you "think" you know how its working try adding to it, i would just give you the code after being called a lier and a thief but i know they will all get arsey on here. Starting to think this community is not very welcoming tbh.

Edited by Gotemp
Link to comment
Share on other sites

could be anything. i once made a program for a game that used pixel search primarily to get info about what was going on in the game, before I learned how to read/write addresses. I had made a function that could identify items in your inventory using pixel search. Instead of searching one pixel it searched five. One "center" pixel and 4 pixels to the up left up right down left and down right of the center one.

Works great but you have to have a pretty good understanding of how pixelsearch works.

Advice to the OP:

Start with one function. Help file is more handy and readily available than posting and waiting, to be told to read the help file :P

Do not bite of more than you can chew. Make one thing work and then move onto integrating something else. In fact, make the two things work separately and then try integrating them, then if you have problems it will be a lot easier to figure out.

If your new to programming I recommend starting with control structures. Start with the IF and else statements and a message box. Try adding some simple numbers, or checking if a variable contains certain data or not. Then move on to loops, starting with the While loop. Something like:

$number = 0

While $number < 10 ; This means the following code will repeat while the variable $number is less than 10

msgbox,0,"My number",$number

$number = $number + 1

wend

This bit of code will display a message box with the value of $number every time it loops through, adding 1 to number each time, and then it will stop when $number equals 10.

Make sure to use scite editor, and make use of ConsoleWrite to keep track of values and error codes for debugging.

Good luck

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