Pixel Predator - PixelSearch Script

Post your working scripts, libraries and tools for AHK v1.1 and older
darkfear42
Posts: 3
Joined: 20 Nov 2021, 10:33

Re: Pixel Predator - PixelSearch Script

Post by darkfear42 » 21 Nov 2021, 10:41

hi hell bent thank you SO SO much for it, it works like a charm now. thank you for taking time to teach someone about it. i hope you have a great xmas and new year!!

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Pixel Predator - PixelSearch Script

Post by Hellbent » 21 Nov 2021, 12:04

darkfear42 wrote:
21 Nov 2021, 10:41
hi hell bent thank you SO SO much for it, it works like a charm now. thank you for taking time to teach someone about it. i hope you have a great xmas and new year!!
You too! And welcome to the forums.

If you are interested in learning how to make your own script ( would allow you to build up a script that does exactly what you want it to instead of my general purpose one ). You can check out this video.



It won't answer all the questions that you might have, but it will give you a much better sense of how code works and how you go about building up a script from scratch.
It is intended for new users such as yourself and it try's to make it easy to actually learn and understand how things work and not just copy and paste.

nexinferis
Posts: 61
Joined: 04 Jan 2022, 05:02

Re: Pixel Predator - PixelSearch Script

Post by nexinferis » 04 Jan 2022, 08:15

How can I do pixel color adjustment and Set Search area section of ​​Pixel predator for my ahk script?

jume
Posts: 22
Joined: 16 Oct 2021, 13:03

Re: Pixel Predator - PixelSearch Script

Post by jume » 10 Jan 2022, 16:43

ow i can add 2 or 3 colors
?

Nier
Posts: 2
Joined: 04 Apr 2022, 21:14

Re: Pixel Predator - Pixel Search Script

Post by Nier » 04 Apr 2022, 23:05

Hellbent wrote:
31 Jan 2019, 10:07
SilentThunder wrote:
30 Jan 2019, 11:09
i love this and use it daily. I actually run multiple instances of it, which brings me to a question. if im running 2 or 3 instances of the pixel predator, is there a way to prioritize them? for example I have 3 colors on screen that need to be clicked on, but I need a specific color clicked before the others. atm they fumble over each other when I have more than one color needing to be clicked.

I hope u can help, I just recently started using scripts, I actually was just looking for an autoclicker when I stumbled upon ur youtube channel. you have opened up a whole world that I never knew existed.
and the way u explain everything is awesome cause i never knew of scripting till i seen ur videos.

This is a good news bad news situation. The bad news is that the amount of effort it would take to get this script to look for multiple colours is about the same amount of effort it would take to rewrite it from scratch. I will likely revisit this sometime down the road, but that could be 6 months to a year away.

The good news is that you can create your own pixel search script in minutes if you omit the Gui and just go with hotkeys.
You can also continue doing it the way you are now (using multiple instances of the script) and adjust the loop delay so that the colours you want to prioritize loop faster, this is not a very good solution, but it might be enough. I'm glad you like this script and i'm also very happy that I was able to bring you into the world of ahk scripting.

Good luck.
I love your work, I'm curious if you ever got around to updating it for multi-coloring. I wish I could script it myself but my knowledge on scripting is virtually zero.

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Pixel Predator - Pixel Search Script

Post by Hellbent » 05 Apr 2022, 03:53

Nier wrote:
04 Apr 2022, 23:05
I love your work, I'm curious if you ever got around to updating it for multi-coloring. I wish I could script it myself but my knowledge on scripting is virtually zero.
Thanks :wave:

You can find the one from the video above your post here.

viewtopic.php?f=18&t=89417#p394143

Nier
Posts: 2
Joined: 04 Apr 2022, 21:14

Re: Pixel Predator - Pixel Search Script

Post by Nier » 08 Apr 2022, 19:47

Hellbent wrote:
05 Apr 2022, 03:53
Nier wrote:
04 Apr 2022, 23:05
I love your work, I'm curious if you ever got around to updating it for multi-coloring. I wish I could script it myself but my knowledge on scripting is virtually zero.
Thanks :wave:

You can find the one from the video above your post here.

viewtopic.php?f=18&t=89417#p394143
Oh wow, I didn't realize the video. Appreciate it.

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 20 Apr 2022, 03:33

Amazing amazing. I've spend so many years to figure out how to write just a script that does some of this. And now you even have it with a Interface menu. Impressive.
It so good, I have just one question.
How do I save the changes i made?
When I close the script it resets.
Sincerely

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Pixel Predator - PixelSearch Script

Post by Hellbent » 20 Apr 2022, 12:03

S1lver wrote:
20 Apr 2022, 03:33
Amazing amazing. I've spend so many years to figure out how to write just a script that does some of this. And now you even have it with a Interface menu. Impressive.
It so good, I have just one question.
How do I save the changes i made?
When I close the script it resets.
Sincerely
I don't want to go into the code myself right now but I can explain how you can edit the code to save your values.

if you put something like this at the top or bottom of the script

Code: Select all

/*
[SavedData]
value1=123
value2=FFFF00
value3=BlahBlahBlah Blah
*/
you can write new data directly to the script using iniWrite and read it later using iniRead.

Code: Select all


#NoEnv 

;Write
value1 := "SomeValue"
iniWrite, % value1 , % A_ScriptFullPath, SavedData, value1 

;Read
iniRead, value1 , % A_ScriptFullPath, SavedData, value1 , ""
msgbox, % value1

With that you can take the variables that get declared near the top of the script and have them use the values you have saved.

To save your values you can either add a hotkey to write the current values or you can make the "Show Send Documentation" button a bit smaller and move it a bit to the left and add a small new button beside it that you can press to save your values.

HTH

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - Pixel Search Script

Post by S1lver » 20 Apr 2022, 13:57

Regarding this:

This script can only deal with 1 color, but you can run more than 1 instance of the script by either saving it in two script files, or by editing
#SingleInstance,Force to #SingleInstance,Off at the top of the script.
__________________________
This had a terrible consequence for me.
it ended up messing with each other when running two windows. so I could not stop the macro when I started the second one. the Numpad keyshortcut did not work, even If i pressed both stop shortcuts. which was set to num2 in the first copy, and num5 in the second one.
It also changed the color from the first one to the second one and the command asawell.

any suggestions?
I've tried setting singlinstace to off, and also made a copy of the script itself. it didn't change

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 20 Apr 2022, 14:02

Hellbent wrote:
20 Apr 2022, 12:03
S1lver wrote:
20 Apr 2022, 03:33
Amazing amazing. I've spend so many years to figure out how to write just a script that does some of this. And now you even have it with a Interface menu. Impressive.
It so good, I have just one question.
How do I save the changes i made?
When I close the script it resets.
Sincerely
I don't want to go into the code myself right now but I can explain how you can edit the code to save your values.

if you put something like this at the top or bottom of the script

Code: Select all

/*
[SavedData]
value1=123
value2=FFFF00
value3=BlahBlahBlah Blah
*/
you can write new data directly to the script using iniWrite and read it later using iniRead.

Code: Select all


#NoEnv 

;Write
value1 := "SomeValue"
iniWrite, % value1 , % A_ScriptFullPath, SavedData, value1 

;Read
iniRead, value1 , % A_ScriptFullPath, SavedData, value1 , ""
msgbox, % value1

With that you can take the variables that get declared near the top of the script and have them use the values you have saved.

To save your values you can either add a hotkey to write the current values or you can make the "Show Send Documentation" button a bit smaller and move it a bit to the left and add a small new button beside it that you can press to save your values.

HTH
oki thx for this. that already went to complex for me I'm sorry. But I will try to see if I can make that work. thank you for trying to help. much appreciated

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 11 Jun 2022, 15:00

amazing thx.
can i in the color field input some text so it will search within a color range. for instance most red'ish colors.
i was thinking I could just put fx. 0x9E0000,50 (0x9E0000 is the specific color I got from using set color and ,50 suppose to mean that color plus similar colors within range of 50). but that didn't work.
Any suggestions?
Sincerely
a fan

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 14 Jun 2022, 05:20

Hellbent wrote:
12 Jan 2019, 12:56
[Mod edit: Huge quote without context removed.]
I don't know if I SHould quote this post so I made a copy of my message. it wasjsut to see if you got notified. love
amazing thx.
can i in the color field input some text so it will search within a color range. for instance most red'ish colors.
i was thinking I could just put fx. 0x9E0000,50 (0x9E0000 is the specific color I got from using set color and ,50 suppose to mean that color plus similar colors within range of 50). but that didn't work.
Any suggestions?
Sincerely
a fan

gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: Pixel Predator - PixelSearch Script

Post by gregster » 14 Jun 2022, 05:35

S1lver wrote:
14 Jun 2022, 05:20
Hellbent wrote:
12 Jan 2019, 12:56
[Mod edit: Huge quote without context removed.]
I don't know if I SHould quote this post so I made a copy of my message. it wasjsut to see if you got notified. love
No, you shouldn't. Please don't create huge quotes with little or no context. Instead you can edit the quote and just keep the relevant bits, like I did above (it will still point to the quoted post, if that matters; just click the upwards arrow).
Or you can use mentions like @S1lver: type @ and then the username you want to mention - at some point you will see a list you can choose from. Or apply mention-tags yourself; or use the @ button of a post. Thank you!

PS: Sometimes people are just (too) busy.

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 15 Jun 2022, 11:31

gregster wrote:
14 Jun 2022, 05:35
S1lver wrote:
14 Jun 2022, 05:20
Hellbent wrote:
12 Jan 2019, 12:56
[Mod edit: Huge quote without context removed.]
No, you shouldn't. y.
there it is
thank you that was very helpful. you answered exactly what I wanted to know. cheers

S1lver
Posts: 23
Joined: 07 Nov 2020, 04:14

Re: Pixel Predator - PixelSearch Script

Post by S1lver » 15 Jun 2022, 14:43

ToddA1 wrote:
26 Dec 2019, 12:01
this is an awesome script. Is there a way to run it without it taking control of the mouse? So that I can still work in other windows while this script runs in its own window.
hey m8. did you figure out how to make this work. I am struggling with the Controlclick function. I can make a ton of scripts working with pixel search, but if I replace Click with Controlclick, the script does nothing.
cheers

redaabdelhady
Posts: 1
Joined: 06 Sep 2022, 18:45

Re: Pixel Predator - PixelSearch Script

Post by redaabdelhady » 06 Sep 2022, 18:50

hello ppl, so iam new at scripting and i found this script but the problem is when i activate for certain pixel it clicks and moves, i just want a script that clicks right mouse button or toggols a button on keyboard when that certain pixel pops up in the search area, thank you for providing this script

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Pixel Predator - PixelSearch Script

Post by Hellbent » 08 Sep 2022, 20:03

redaabdelhady wrote:
06 Sep 2022, 18:50
hello ppl, so iam new at scripting and i found this script but the problem is when i activate for certain pixel it clicks and moves, i just want a script that clicks right mouse button or toggols a button on keyboard when that certain pixel pops up in the search area, thank you for providing this script
Refer to the command line params. ( Press the "?" button )

chipso
Posts: 2
Joined: 20 Sep 2022, 05:44

Re: Pixel Predator - PixelSearch Script

Post by chipso » 20 Sep 2022, 06:00

Love your script, it really is a god send!
I'm editing your script so it loads my preferred configurations by adjusting the global settings, so I don't have to do it every time I open the script. I've successfully changed the color and it loads with what I edited it to. However when I change the X Y W and H to my preferred coordinates, it's still "nill" when the GUI loads. What do I need to change so it shows what I've edited.... in the GUI. Thanks.
My settings: global HB_Button:=[],Selected_Color:="000000",Color_Edit:="0x000000",Stop:=0,X_Pos:="1500",Y_Pos:="688",W_Pos:="73",H_Pos:="27",cx2:="",cy2:="",cx:="",cy:=""

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Pixel Predator - PixelSearch Script

Post by Hellbent » 20 Sep 2022, 15:01

chipso wrote:
20 Sep 2022, 06:00
Love your script, it really is a god send!
I'm editing your script so it loads my preferred configurations by adjusting the global settings, so I don't have to do it every time I open the script. I've successfully changed the color and it loads with what I edited it to. However when I change the X Y W and H to my preferred coordinates, it's still "nill" when the GUI loads. What do I need to change so it shows what I've edited.... in the GUI. Thanks.
My settings: global HB_Button:=[],Selected_Color:="000000",Color_Edit:="0x000000",Stop:=0,X_Pos:="1500",Y_Pos:="688",W_Pos:="73",H_Pos:="27",cx2:="",cy2:="",cx:="",cy:=""
You need to set the edit controls like so.

Code: Select all

Gui,1:Add,Edit, x175 y100 w40 h22 Center ReadOnly vX_Pos, % X_Pos
Gui,1:Add,Edit, x245 y100 w40 h22 Center ReadOnly vY_Pos, % Y_Pos
Gui,1:Add,Edit, x315 y100 w40 h22 Center ReadOnly vW_Pos, % W_Pos
Gui,1:Add,Edit, x385 y100 w40 h22 Center ReadOnly vH_Pos, % H_Pos
You also need to set the cx2 and cy2 values like so.

Code: Select all

, cx2 := X_Pos + W_Pos
, cy2 := Y_Pos + H_Pos
Hope that helps.

Post Reply

Return to “Scripts and Functions (v1)”