jacob_1998_1999 Posted July 16, 2006 Posted July 16, 2006 Func Game() $oForm2 = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm2, 0) $oGuess = 100 _IEFormElementSetValue ($oQuery, 100) _IEFormSubmit($oForm2) _IELoadWait($oIE) If String("& won 0") Then $oGuess = $oGuess * 2 _IEFormElementSetValue ($oQuery,$oGuess) _IEFormSubmit($oForm2) _IELoadWait($oIE) Game() Else Game() EndIf EndFunc As far as I can tell.. This is not submitting at all.. and the Check for "& won 0" is giving false positive.. because it continues through the If Statement. All this does is infinitly cycle "100" and "200" in the field of the form that I want.. It is never submitting.. Below is the entire Form I am trying to get submitted .. I'm sorry that I cannot seem to do this myself. <table style="width:200px"> <FORM method="post" action="/cna.php"> <tr> <td width="33" align="middle"> <img src="/images/g_Crown.jpg"> <br> <input type="text" name="Crown" size="5" value="100"> </td> <td width="33" align="middle"> <img src="/images/g_Anchor.jpg"> <br> <input type="text" name="Anchor" size="5" value="0"> </td> <tr> <td colspan="3" align="middle"> <input type="hidden" name="tkid" value="ea2a7e11872b81fc1a8db4f1f3ecca8f"> <INPUT TYPE="submit" VALUE="roll the dice" name="submit" class="submit"> </td> </tr> </FORM> Ty for any and all help.
w0uter Posted July 16, 2006 Posted July 16, 2006 (edited) all string does is typecast it into a string. also you are gonna hit a recursion limit. Edited July 16, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
jacob_1998_1999 Posted July 16, 2006 Author Posted July 16, 2006 all string does is typecast it into a string.also you are gonna hit a recursion limit.Am I going to have to parse the entire page to find out if " & won 0" occures? In theory, is the rest of my coding correct? I'm just a little lost..
jacob_1998_1999 Posted July 16, 2006 Author Posted July 16, 2006 (edited) Func Game() $oGuess = 100 $oForm2 = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm2, 0) _IEFormElementSetValue ($oQuery, $oGuess) $oButton = _IEFormElementGetObjByName($oForm2, "submit") $oButton.click() _IELoadWait($oIE) sleep(2000) If WinExists("blahblah - Microsoft Internet Explorer") Then $Text1=WinGetText("blahblah - Microsoft Internet Explorer") If Stringinstr($Text1, "& won 0") Then $oGuess = $oGuess * 2 $oForm2 = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm2, 0) _IEFormElementSetValue ($oQuery, $oGuess) $oButton = _IEFormElementGetObjByName($oForm2, "submit") $oButton.click() _IELoadWait($oIE) sleep(2000) Game() Else Game() EndIf EndIf EndFunc I tried going about this another way... From what I can tell.. It still is not reading, or ignoring when/if "& won 0" is present. And/Or the Doubling of $oGuess is not working. P.S. The author wrote these page weird, so the $oButton is about the only way to make the form actually submit. Edited July 16, 2006 by jacob_1998_1999
Developers Jos Posted July 16, 2006 Developers Posted July 16, 2006 Func Game() -snip Game() Else Game() EndIf EndIf EndFuncWhat is the purpose of these 2 calls to Game() ? This means to me that the Game() func will never properly end and keeps on calling itself ending in a recursion level error ...... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
jacob_1998_1999 Posted July 16, 2006 Author Posted July 16, 2006 (edited) What is the purpose of these 2 calls to Game() ? This means to me that the Game() func will never properly end and keeps on calling itself ending in a recursion level error ......Well, I would like it to be endlessly run until I stop it. via HotKey or Force. So, I assumed that calling it to the beginning would accomplish this. Perhaps if I just type out what I want to accomplish it will be easier to understand?From the Start.Type Guess(100 for the first time)SubmitIf "& won 0" exists Then Double GuessElse Type TheFirstGuess(100 again.. So, I assumed loop to beginning.)EndIfrepeat endlessly. Edited July 16, 2006 by jacob_1998_1999
Developers Jos Posted July 16, 2006 Developers Posted July 16, 2006 Well, I would like it to be endlessly run until I stop it. via HotKey or Force. So, I assumed that calling it to the beginning would accomplish this. Perhaps if I just type out what I want to accomplish it will be easier to understand? From the Start. Type Guess(100 for the first time) Submit If "& won 0" exists Then Double Guess Else Type TheFirstGuess(100 again.. So, I assumed loop to beginning.) EndIf repeat endlessly.There is a big difference between the below 2 scripts ... first one is the correct approach: While 1 Game() Wend Func Game() ; your stuff and NO callls to game() EndFunc oÝ÷ Ù«¢+Ø)µ ¤()Õ¹µ ¤(ìå½ÕÈÍÑÕ¹9 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
jacob_1998_1999 Posted July 16, 2006 Author Posted July 16, 2006 (edited) While 1 Game() WEnd Func Game() If WinExists("adfhadf - Microsoft Internet Explorer") Then $oGuess = 100 $oForm2 = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm2, 0) _IEFormElementSetValue ($oQuery, $oGuess) $oButton = _IEFormElementGetObjByName($oForm2, "submit") $oButton.click() _IELoadWait($oIE) sleep(2000) If WinExists("adfhadfh - Microsoft Internet Explorer") Then $Text1=WinGetText("adfhadh - Microsoft Internet Explorer") MsgBox(0,"",$Text1) If Stringinstr($Text1, "& won 0") Then $oGuess = $oGuess * 2 $oForm2 = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm2, 0) _IEFormElementSetValue ($oQuery, $oGuess) $oButton = _IEFormElementGetObjByName($oForm2, "submit") $oButton.click() _IELoadWait($oIE) sleep(2000) EndIf Else EndIf Else MsgBox(0,"D'oh!","Something is wrong.;(") EndIf EndFuncThe WinGetText Is returning:Linkshttp://baldfhnlajdhhttp://absndlfjhnadlhDoneI just cannot seem to be able to get the Text that I want found. Edit:I tried adding work arounds using: _INetGetSource('http://linkage.wooo.yea')However the site doesn't allow this and it resets to the main..Is there a way to just gather the source (to parse it) from the present IE page you are on? Edited July 16, 2006 by jacob_1998_1999
jacob_1998_1999 Posted July 17, 2006 Author Posted July 17, 2006 Its not able to be read like that. :/ So I need a way to get the source from the page and then search that source, and As I said previously InetGetSource doesn't work.
jacob_1998_1999 Posted July 17, 2006 Author Posted July 17, 2006 _IEBodyReadText ($oIE) Ty for the revisitation in structure JdeB.
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