Open Side Menu Go to the Top

02-07-2008 , 08:57 PM
I would like a script that just types in the letter B,

but ONLY when there is a window with the size of 200 by 300 pixels.


So it would be something like:

======================
ifwinexist 200x300 pixels
send B
======================

A simple script request if possible Quote
A simple script request if possible
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
A simple script request if possible
02-07-2008 , 09:21 PM
that will do it. sorta. is there not a better way to recognize the window (such as it's ahk_class) ?

what is this for?
A simple script request if possible Quote
02-08-2008 , 08:41 AM
Could you write it so that I can just copy-paste the 3 or 4 lines of text and save it as an AHK file?

Because I cant get it to work...

This is the best way if possible, its for some automated copying.

tyvm.
A simple script request if possible Quote
02-12-2008 , 11:03 AM


bump
A simple script request if possible Quote
02-12-2008 , 11:09 AM
so you want the script to constantly check for a 300x200 window and hit 'B' if one exists? will there be more windows of this kind or just one? give us some information

if you use the ifwinexists command in that way.. the script will perform this check just once
A simple script request if possible Quote
02-12-2008 , 12:57 PM
Quote:
Originally Posted by tsod
so you want the script to constantly check for a 300x200 window and hit 'B' if one exists?
yes.

Quote:
Originally Posted by tsod
will there be more windows of this kind
or just one?
Just one popping up every now and then.

Quote:
if you use the ifwinexists command in that way.. the script will perform this check just once
I need the script to constant monitor for the 300X200 window.

Maybe it works with the command: 'LOOP'
A simple script request if possible Quote
02-12-2008 , 02:06 PM
yep, you could use the setTimer function for that
but you will need the title of the window, or its class or something as there is no function to get a window by its size only

i would recommend you check the properties of the window with ahk's window spy utility and find something else to identify the window with

then you could easily follow the examples given in the setTimer and IfWinExists documentation
A simple script request if possible Quote
02-12-2008 , 02:08 PM
Quote:
Originally Posted by tsod
there is no function to get a window by its size only
Aha, all I needed to know. ty.

Quote:
Originally Posted by tsod
i would recommend you check the properties of the window with ahk's window
spy utility and find something else to identify the window

then you could easily follow the examples given in the setTimer and IfWinExists documentation
Im on it right now.

Just thought it had to be possible with the size of the window.
A simple script request if possible Quote
02-12-2008 , 02:12 PM
it is not impossible.. but as there is no direct function its way easier this way
A simple script request if possible Quote
02-12-2008 , 02:27 PM
Oh, ok, i get it.
A simple script request if possible Quote
02-12-2008 , 03:31 PM
Yeah that's why I asked if there was any identifying "ahk_class" to narrow the search.

Can do it easily without, but it requires getting the size of ALL windows, which could be a bit intensive / lead to false hits.
A simple script request if possible Quote
02-12-2008 , 04:20 PM
Maybe this works:
Code:
SetTimer, Check, 100
Check:
  WinGet, list, List
  Loop, %list%
  {
    id := list%A_Index%
    WinGetPos,,, w, h, ahk_id %id%
    If (w = 300) and (h = 200)
      Send B		
  }
Return
A simple script request if possible Quote
02-12-2008 , 04:33 PM
indeed it should. that is the one checking the whole window list

I'd probably put in a sleep for a few seconds after sending the B, but it may not be necessary.
A simple script request if possible Quote
02-12-2008 , 04:58 PM
clap clap
A simple script request if possible Quote
02-12-2008 , 05:10 PM
Thanks canta!

And thanks all.

Wasting other guys time is my hobby.
A simple script request if possible Quote
A simple script request if possible
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
A simple script request if possible

      
m