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 

Wait for web or for any page loaded with image search.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
LazyLarry
Guest





PostPosted: Sun Apr 30, 2006 2:15 pm    Post subject: Wait for web or for any page loaded with image search. Reply with quote

I work with mutiple applicaiotns, pages, e.g. Oraclie, Fox DB, Delphi, alll networked along with Word, Excel, and looks like more of this than less.

Some have the same title, but different pages, WinGetTitle, WinText, WinWait, StatusBarText and the like do not always work, and a lot of AHK trial and error, frequent Sleeps etc get the job done.

AHK has so many features, that it is difficult to understand them all, any one could be a script destroyer, and for a poor scripter as myself, there is not enough time to work and play at htis enjoyable activity.

Then i started experimenting with ImageSearch and by comparison it is rock solid.

The core is the same as "Richard's" script and all these I would guess work the same way.

This script as is, would not work, one would need corresponding Imagings to search, but one can see how adapatable it would be to any beginner faced with similiar problems.

Code:
;===== start of image search script ===
InputBox, password, Enter Password, (your input will be hidden), hide
SetKeyDelay, 20
StartSequence=https://www1.royalbank.com/cgi-bin/rbaccess/rbunxcgi?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE=ENGLISH
WinTitle = RBC Financial Group - Online Banking

Msg1=1/3 Requested Sign in Page - Waiting for 4519
Msg2=2/3 Sent Password -  Waiting for "View" Button
Msg3=3/3 "View" button arrived - Wait for page to settle down before click
Msg4=This concludes the Royal Bank Script

Img1= SignIn4519 ; RoyalBankViewSecondPage, don't put the .bmp extension here, it is added later see line32
Img2= RoyalBankViewSecondPage ;
Img3= RoyalBankViewSecondPage ; yes it is the same, this page seems to jump upon arrival(or firefox is repositioning it)
Img4 = rbViewAccount

GoSub STANDARD ; more variables but more consistent with other applicatons

;========== PAGE 1 WORK
GoSub SUB ; follow is any bank / client number but noyt real on
send, 2222222222
Send {tab}
sleep, 60
send, %password%{enter}

;=========== PAGE 2 WORK
GoSub SUB

;=========== PAGE 3 WORK
sleep 2500 ; wait for page to settle down
GoSub SUB
click %x% %y%
soundplay, %dir%YourBankAccountisReadyforViewing.wav, 1 ; ViewYourAccount.wav, 1 ; a nce british sounding voice here,
EXITAPP

;############ SUB #########
SUB:
Msg:=Msg%Page%
Img:=Img%Page%
SplashImage, ,x300 y650 W385 H30 B1, %Msg%
Loop
  {
    ImageSearch,x, y, %X1%, %Y1%, %X2%, %Y2%,%dir%%Img%.bmp
   LoopCount -= 1
   ToolTip, LoopCount Countdown %loopcount%
   If Errorlevel = 0 ; image found
      break
   If (LoopCount <1)
         {
         MsgBox,,,%DIR%%IMG%%PAGE%.BMP Not Found lOOPC %lOOPcOUNT%,200
         exitapp
       }
   Sleep %LoopSleepInterval%
    }
Page += 1 ; determines the next imagines and messages to be used
RETURN
;#########################

;###### THESE STANDARD VARIABLES / PROCESS WOULD BE CONSISTENT FOR MANY USES.
STANDARD:
dir=c:\4\
X1= 100 ; so as not to pick up the image in splashimage but in window Password is near top
Y1 = 100
X2 = 700 ; Click 501 265
Y2 = 600 ; Click 589 298
LoopCount=70
LoopSleepInterval=100
Page = 1
IfWinNotExist, %WinTitle% ; in case a failed previous launch left the page existing
   {
   RunWait, %StartSequence%
   }
WinActivate, %WinActivate%
RETURN
;######################################################
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
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