chie Posted November 2, 2006 Posted November 2, 2006 (edited) What im trying to do is to serch the wabpage for a many different phrases (lets say up to 5 phrases) & if correct phrase was found, then do something & go to beginning of prog & if not found, then continue search until prase is found etc. I tried & tried but no mather what i used I was unable to figure out how can i make the prog to go to beginning if the phrase was found. so far I can go so far that i can make the program to check for some phrases & if correct one is found, then it does the action but it wont go to beginning after the action is done(after the phrase was found), insted the prog will continue running & checking for next phrases....& this makes my PC go crazy: Check for phrase 1... ...If found, do something &... ...go to program beginning... ...If phrase 1 not found... ...Check for phrase 2... ...If found phrase 2 , do something & then... ...go to program beginning... ...If phrase 2 not found... ...Check for phrase 3... ...If found phrase 3 , do something & then... ...go to program beginning... ...If phrase 3 not found... ...Check for phrase 4...etc until phrase is found, then do something & go to beginning Any hints would be appreciated, Hire are 2 examples of the code that will only check for 1 phrase(so u can copy paste if someone decides to help me out)....I wont post my other code, since its really messy & does not work as need anyway. CODE 1 expandcollapse popup$g_szVersion = "Filesaver IE using IDM" If WinExists($g_szVersion) Then Exit ; Exits without notification if 1 copy is already running AutoItWinSetTitle($g_szVersion) HotKeySet("!{numpadsub}", "START") HotKeySet("!{numpadadd}", "HK_STOP") HotKeySet("!z", "MyExit") ; exit prog Func START() While 1 = 1 ;~ ************************************************************************* ;~ Search for phrase 1 ;~ ------------------------------------------------------------------------- send("^{f}") Sleep(1500) send("phrase 1") send("{enter}") ;~ If phrase 1 was not found then hit ESC ;~ ------------------------------------------------------------------------- if WinActive("Microsoft Internet Explorer") then ; Sleep(1500) send("{esc}") Else ;~ If phrase 1 was found click the link ;~ ------------------------------------------------------------------------- send("{esc}") send("{tab}") send("{enter}") EndIf ;~ If phrase 1 was found Go to program beginning ;~ ************************************************************************* Wend EndFunc Func HK_STOP() ;Stops the program while 1 = 1 Sleep(10) wend EndFunc While 1; Need to keep the program running until you press the hotkey Sleep(100) WEnd Func MyExit() ; Function to exot prog Exit EndFuncoÝ÷ Ø#f®¶sbb33c¶u÷7¥fW'6öâÒgV÷C´RfÆRF÷væÆöB67&BgV÷C°¤bväW7G2b33c¶u÷7¥fW'6öâFVâWB²WG2vF÷WBæ÷Ff6Föâb6÷2Ç&VG'Væææp¤WFôEvå6WEFFÆRb33c¶u÷7¥fW'6öâ ¤÷D¶W6WBgV÷C·¶çV×G7V'ÒgV÷C²ÂgV÷Cµ5D%BgV÷C²¤÷D¶W6WBgV÷C·¶çV×FFGÒgV÷C²ÂgV÷C´µõ5DõgV÷C²¤÷D¶W6WBgV÷C²b333·¢gV÷C²ÂgV÷C´×WBgV÷C² ¢b33c¶ÒgV÷C¶×2Â6fRgV÷C°¢b33c¶#ÒgV÷C·F2fÆRÂgV÷C°¢b33c¶3ÒgV÷C¶F÷væÆöC²gV÷C° ¤gVæ25D%B £·âvÆRÒ²æfæFfRÆö÷ £·â¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢ £·â6V&6f÷"×2Â6fP£·âÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÐ 6VæBgV÷C·¶öÖWÒgV÷C² 6ÆVW 6VæBgV÷Cµç¶gÒgV÷C² 6ÆVW 6VæBb33c¶·6V&6f÷"F2FW@ 6VæBgV÷C·¶VçFW'ÒgV÷C² 6VÆV7@£·âbgV÷C¶æ÷Bf÷VæBgV÷C²væF÷r2F7ÆVBFVâBU40£·âÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÐ 66Rvä7FfRgV÷C´Ö7&÷6ögBçFW&æWBWÆ÷&W"gV÷C² 6VæBgV÷C·¶W67ÒgV÷C² 6VæBgV÷C·¶W67ÒgV÷C² 6ÆVWS 6VæBgV÷C·¶öÖWÒgV÷C²¢66RVÇ6R £·âb&6Rv2f÷VæB6Æ6²FRÆæ°£·âÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÐ 6VæBgV÷C·¶W67ÒgV÷C² 6ÆVWS 6VæBgV÷C··F'ÒgV÷C² 6ÆVWS 6VæBgV÷C·¶VçFW'ÒgV÷C²£·âb&6Rv2f÷VæBvòFò&öw&Ò&Vvæææp£·â¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢ ¤VæE6VÆV7@£·âvVæ@¤VæDgVæ0 ¤gVæ2µõ5Dõµ7F÷2FR&öw&ЧvÆRÒ¢6ÆVW§vVæ@¤VæDgVæ0 ¥vÆR²æVVBFò¶VWFR&öw&Ò'VææærVçFÂ÷R&W72FR÷F¶W¢6ÆVW¥tVæ@ ¤gVæ2×WB²gVæ7FöâFòW÷B&öp¢WB¤VæDgVæ Edited November 3, 2006 by chie
jvanegmond Posted November 2, 2006 Posted November 2, 2006 Hmm, _IECreate, _IEBodyReadText and StringInStr. github.com/jvanegmond
chie Posted November 3, 2006 Author Posted November 3, 2006 oh my no replies , is this really so complicated? Hmm, _IECreate, _IEBodyReadText and StringInStr.can u explane how StringInStr can be useful to solve my small problem?
Moderators SmOke_N Posted November 3, 2006 Moderators Posted November 3, 2006 oh my no replies , is this really so complicated? can u explane how StringInStr can be useful to solve my small problem?http://www.autoitscript.com/forum/index.ph...c=35090&hl= Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
chie Posted November 3, 2006 Author Posted November 3, 2006 (edited) BIG Edit:Well it took several days & i came up with this idea that woks for meexpandcollapse popup$g_szVersion = "Filesaver IE using IDM" If WinExists($g_szVersion) Then Exit ; Exits without notification if 1 copy is already running AutoItWinSetTitle($g_szVersion) HotKeySet("{numpadsub}", "START") HotKeySet("{numpadadd}", "HK_STOP") HotKeySet("!z", "MyExit") Func START() ;~ Open new page ;~ ------------------------------------------------------------------------- send("{tab}") Sleep(500) send("{APPSKEY}") send("{down}") send("{down}") send("{enter}") Sleep(4000) while 1 ; Begin loop ;~ Search for WORD 1 ;~ ------------------------------------------------------------------------- send("^{f}") Sleep(300) Send("download") Sleep(300) send("{enter}") Sleep(300) ;~ If keyword was not found close search window ;~ ------------------------------------------------------------------------- if WinActive("Microsoft Internet Explorer") then ; Sleep(300) send("{esc}") Sleep(300) send("{esc}") Sleep(700) Else ;~ If keyword was found click the link, close active window , & open next window ;~ ------------------------------------------------------------------------- send("{esc}") Sleep(300) send("{tab}") Sleep(300) send("{enter}") Sleep(500) send("!{F4}") Sleep(300) WinWaitActive("Futakoi Original Soundtrack MP3s & Downloads - Microsoft Internet Explore") send("{tab}") Sleep(300) send("{APPSKEY}") send("{down}") send("{down}") send("{enter}") Sleep(5500) EndIf ;~ ************************************************************************* ;~ Search for WORD 2 ;~ ************************************************************************* send("^{f}") Sleep(300) Send("this file,") Sleep(300) send("{enter}") Sleep(300) ;~ If keyword was not found close search window ;~ ------------------------------------------------------------------------- if WinActive("Microsoft Internet Explorer") then ; Sleep(300) send("{esc}") Sleep(300) send("{esc}") Sleep(700) Else ;~ If keyword was found click the link, close active window , & open next window ;~ ------------------------------------------------------------------------- send("{esc}") Sleep(300) send("{tab}") Sleep(300) send("{enter}") Sleep(500) send("!{F4}") Sleep(300) WinWaitActive("Futakoi Original Soundtrack MP3s & Downloads - Microsoft Internet Explore") send("{tab}") Sleep(300) send("{APPSKEY}") send("{down}") send("{down}") send("{enter}") Sleep(5500) EndIf ;~ ************************************************************************* ;~ Search for WORD 3 ;~ ************************************************************************* send("^{f}") Sleep(300) Send("this file,") Sleep(300) send("{enter}") Sleep(300) ;~ If keyword was not found close search window ;~ ------------------------------------------------------------------------- if WinActive("Microsoft Internet Explorer") then ; Sleep(300) send("{esc}") Sleep(300) send("{esc}") Sleep(700) Else ;~ If keyword was found click the link, close active window , & open next window ;~ ------------------------------------------------------------------------- send("{esc}") Sleep(300) send("{tab}") Sleep(300) send("{enter}") Sleep(500) send("!{F4}") Sleep(300) WinWaitActive("Futakoi Original Soundtrack MP3s & Downloads - Microsoft Internet Explore") send("{tab}") Sleep(300) send("{APPSKEY}") send("{down}") send("{down}") send("{enter}") Sleep(5500) EndIf wend ; Loop end EndFunc Func HK_STOP() ;Stops the program while 1 = 1 Sleep(100) wend EndFunc While 1; Need to keep the program running until you press the hotkey Sleep(100) WEnd Func MyExit() ; Function to exit prog Exit EndFuncoÝ÷ Ø(µ©b¶Ù^n+lªíz¶¦¦Øhºm",¶f§ÊئzË"^²n¶*'jëh×6#include <IE.au3> $oIE = _IE_Example ("basic") ; open sample page $oBOdy = _IEBodyReadText($oIE) ;Search page text if StringInStr($oBody, "orted") Then MsgBox(0, "","Bingo") ;if text "orted" found = MsgBox Edited November 22, 2006 by chie
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now