AutoHotkey Community

It is currently May 27th, 2012, 11:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 10th, 2009, 5:27 pm 
Offline

Joined: May 3rd, 2009, 7:16 pm
Posts: 345
Location: OH, USA
Taking the path name from one of your previous posts, this should get you started:

Code:
Loop
{
   ImageSearch, x, y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\My Images\question_%A_Index%.jpg
   If (ErrorLevel = 2) ; failed to open image
      Break
   If (ErrorLevel = 0) ; image found
   {
      MsgBox found question %A_Index% at: %x%x%y%
      Break
   }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2009, 8:35 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Keavon wrote:
Hmmm, the example you gave me had some kind of error.
Can you be more specific ?

The steps in your Sat Oct 10 post make complete sense to me.

Solar's post seems right on, as well.

I'm trying to write a script that allows you to mark the needed points
Code:
tt_list = ImageTopLeft,ImageBottomRight,Check1,Check2,Check3,Continue


And then automate the image and answer gathering.

Here is what I have so far:
Code:
#singleinstance force

;================================================================
; auto execute section & emergency exit hotkey
;================================================================


settitlematchmode 2

CoordMode, ToolTip, screen
CoordMode, Mouse, screen
CoordMode, Pixel, screen

inifile = mark.ini   ; where to write the coordinates
max_questions = 27   ; the total number of questions to look for

image_filename= C:\My Images\question_

tt_list = ImageTopLeft,ImageBottomRight,Check1,Check2,Check3,Continue

Loop, parse, tt_list, `,
{
;    MsgBox, ToolTip number %A_Index% is %A_LoopField%.
tt_txt%A_Index%:=A_LoopField
tt_cnt:=A_Index
}
;listvars
;msgbox %tt_cnt%

a=1

return


esc::   ; in case of emergency, hit escape to exit script
exitapp


;================================================================
;
;================================================================

#q::   ; hit win-q to start the process
if (a > tt_cnt)
  return
;msgbox %tt_cnt%
;msgbox timerset
a=1
SetTimer, WatchCursor, 100

Hotkey, ~lbutton, mark_points

return

mark_points:
MouseGetPos, xpos, ypos
ToolTip, % tt_txt%A% , xpos , ypos, a
x%a%:=xpos
y%a%:=ypos

;msgbox % x%a% "!" y%a%


a++

if (a > tt_cnt)
{
  SetTimer, WatchCursor, off
   ToolTip,  ,  , , 20 ; erase the markers
  msgbox that's all the points to mark`n press ok save to ini file
  Hotkey, ~lbutton, off

  loop,  %tt_cnt%
  {
    iniwrite, % tt_txt%A_Index% , %inifile%, none, tt_txt%A_Index%
    iniwrite, % x%A_Index% , %inifile%, none, x%A_Index%
    iniwrite, % y%A_Index% , %inifile%, none, y%A_Index%

    ToolTip,  ,  , , a_index ; erase the markers

  }
   ToolTip,  ,  , , 20 ; erase the markers


  iniwrite, %max_questions% , %inifile%, none, max_questions
  iniwrite, 0 , %inifile%, none, saved_questions

}
else
{
SetTimer, WatchCursor, 100
   ToolTip,  ,  , , 20 ; erase the markers

}

return


WatchCursor:
MouseGetPos, xpos, ypos
ToolTip, % tt_txt%A%, xpos, ypos, 20
return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, Yahoo [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group