AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Creating a transparent window, which contains a pixelSearch?
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Wed Nov 18, 2009 11:17 am    Post subject: Creating a transparent window, which contains a pixelSearch? Reply with quote

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
View user's profile Send private message MSN Messenger
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Wed Nov 18, 2009 3:56 pm    Post subject: Reply with quote

PLease can somone answer my qestion?
_________________
---{+.-}---
Back to top
View user's profile Send private message MSN Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Wed Nov 18, 2009 5:50 pm    Post subject: Reply with quote

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) Wink
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Thu Nov 19, 2009 2:46 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Thu Nov 19, 2009 4:43 am    Post subject: Reply with quote

anyone?
i would realy like somehelp with the script=S
_________________
---{+.-}---
Back to top
View user's profile Send private message MSN Messenger
Flight4birds



Joined: 06 Mar 2008
Posts: 103
Location: West

PostPosted: Thu Nov 19, 2009 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Thu Nov 19, 2009 1:21 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Thu Nov 19, 2009 2:28 pm    Post subject: Reply with quote

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) Wink
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Thu Nov 19, 2009 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Thu Nov 19, 2009 5:00 pm    Post subject: Reply with quote

Cyber wrote:
does that make sense.


The box does not make any sense Confused
_________________
AutoHotFile - ToolTip(n,text,title,options) Wink
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Fri Nov 20, 2009 3:07 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 7:16 am    Post subject: Reply with quote

So you need the window to exclude this area from PixelSearch?
_________________
AutoHotFile - ToolTip(n,text,title,options) Wink
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 82
Location: Nsw/Syd/Kiama

PostPosted: Fri Nov 20, 2009 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 2:33 pm    Post subject: Reply with quote

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) Question
_________________
AutoHotFile - ToolTip(n,text,title,options) Wink
Back to top
View user's profile Send private message
gunns256



Joined: 25 Oct 2009
Posts: 11

PostPosted: Fri Nov 20, 2009 3:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group