 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Wed Nov 18, 2009 11:17 am Post subject: Creating a transparent window, which contains a pixelSearch? |
|
|
hey ahk community.
Ok so i have a code that creates a gui transparent window...
it is quite small, and i was wondering how could i use pixel search in corprated with this script, the easist way to explain is with an example.
eg.
i have a small window centerd in the screen, if a selectred color becomes visible underneath this window then send the control "leftclick"
here is my current script
| Code: |
bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDim% H%bDim% X%xPos% Y%yPos%, hitBox
WinWait, hitBox
WinSet, TransColor, C0C0C0 255, hitBox
|
if anyone has any pointers or genral links on what i need to learn i would be most greatfull=)
~cyber _________________ ---{+.-}---
Last edited by Cyber on Thu Nov 19, 2009 3:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Wed Nov 18, 2009 3:56 pm Post subject: |
|
|
PLease can somone answer my qestion? _________________ ---{+.-}--- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Wed Nov 18, 2009 5:50 pm Post subject: |
|
|
Possibly something like this: | Code: | bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Loop
{
PixelSearch,x,y,% xPos,% yPos,% xPos + (bDim*2),% yPos + (bDim*2),C0C0C0,0,RGB
If !ErrorLevel
Click
}
Esc::ExitApp |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Thu Nov 19, 2009 2:46 am Post subject: |
|
|
ok, so far iv go this.
| Code: |
bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDim% H%bDim% X%xPos% Y%yPos%, hitBox
WinWait, hitBox
WinSet, TransColor, C0C0C0 255, hitBox
Loop
{
PixelSearch,x,y,% xPos,% yPos,% xPos + (bDim*2),% yPos + (bDim*2),0x31FCFD,10,RGB
If !ErrorLevel
Click
}
^z::ExitApp
|
i have a brief understanding of what it does, i can read better then i can write it =s
anyway, stilltherer is a problem,
1: it isnt always ontop- eg, when i play a fullscreen game.
2: it doesnt left click the desired color in the box.
any ideas anyone? _________________ ---{+.-}--- |
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Thu Nov 19, 2009 4:43 am Post subject: |
|
|
anyone?
i would realy like somehelp with the script=S _________________ ---{+.-}--- |
|
| Back to top |
|
 |
Flight4birds
Joined: 06 Mar 2008 Posts: 103 Location: West
|
Posted: Thu Nov 19, 2009 5:28 am Post subject: |
|
|
try this for the AlwaysOnTop problem
| Code: |
bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Gui, +alwaysontop
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDim% H%bDim% X%xPos% Y%yPos%, hitBox
WinWait, hitBox
WinSet, TransColor, C0C0C0 255, hitBox
Loop
{
PixelSearch,x,y,% xPos,% yPos,% xPos + (bDim*2),% yPos + (bDim*2),0x31FCFD,10,RGB
If !ErrorLevel
Click
}
^z::ExitApp |
|
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Thu Nov 19, 2009 1:21 pm Post subject: |
|
|
still doesnt stay on top.
=s
and still doesnt click the dseired color.
prety much all i have done is made a square in the middle of the screen that doesnt do anything , accept disapear when its suposed to be there =s
great XD
anyone else?
would really aprciate help
once agin these are my problems
1: it isnt always ontop- eg, when i play a fullscreen game.
2: it doesnt left click the desired color in the box.
3:and a new problem is when the script is loading it slows down my computer a fair bit, but thats just a minor problem to be fixed later on _________________ ---{+.-}--- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Thu Nov 19, 2009 2:28 pm Post subject: |
|
|
| Cyber wrote: | 1: it isnt always ontop- eg, when i play a fullscreen game.
2: it doesnt left click the desired color in the box.
3:and a new problem is when the script is loading it slows down my computer a fair bit, but thats just a minor problem to be fixed later on |
As far as I know, in a fullscreen game it might not click as it uses direct input:
1. not possible
2. still do not understand what you want to do
3. must be due to PixelSearch, you could put a Sleep before starting search. _________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Thu Nov 19, 2009 2:59 pm Post subject: |
|
|
well in regards to question number 2.
i am trying to make a small centred box that is always on top and in the midle of the screen. if "green" becoms behind the box then send the command left click.
and example.
say your playing a game.. and you have a crosshair, make the square box the same size as the crosshair, now if a npc or character runs infront of the cross hair and it green then send the command leftclick.
does that make sense.
can someone please give me a hand with making this possible.
thanks
~cyber _________________ ---{+.-}--- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Fri Nov 20, 2009 3:07 am Post subject: |
|
|
iv tryed to explain it as best as i can.
here si the script, run it and you wil se the box.
[/code]
bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Gui, +alwaysontop
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDim% H%bDim% X%xPos% Y%yPos%, hitBox
WinWait, hitBox
WinSet, TransColor, C0C0C0 255, hitBox
Loop
{
PixelSearch,x,y,% xPos,% yPos,% xPos + (bDim*2),% yPos + (bDim*2),0x31FCFD,10,RGB
If !ErrorLevel
Click
}
^z::ExitApp
[/code]
As you will see the pixel search wont work within it.
and if you play aroudn with it yo will also notice it wont alwyas be ontop=s _________________ ---{+.-}--- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
|
| Back to top |
|
 |
Cyber
Joined: 10 Mar 2009 Posts: 82 Location: Nsw/Syd/Kiama
|
Posted: Fri Nov 20, 2009 1:22 pm Post subject: |
|
|
no the oposite.
only inside this window i whant a pixel search.
so it searches the color green.. only inside the window.
thanks _________________ ---{+.-}--- |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Fri Nov 20, 2009 2:33 pm Post subject: |
|
|
This again makes no sense.
Why do you want to search in window?
In Pixelsearch you can specify the area where to search (X1, Y1, X2, Y2)  _________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
gunns256
Joined: 25 Oct 2009 Posts: 11
|
Posted: Fri Nov 20, 2009 3:18 pm Post subject: |
|
|
I'm a n00b, so take this with salt.
From manual: The region to be searched must be visible; in other words, it is not possible to search a region of a window hidden behind another window.
Is this the problem? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|