blade Posted July 18, 2014 Share Posted July 18, 2014 Hello, I'm new to this coding but have almost finished my first script to create sites for me, but some sites have a price so I'm trying to stop the script from running if the id >$0.00. I'm using the Google calculator for a reference, if I start the Google calculator and have the $oLink = _IEGetObjById($oIE, "cwos") it will get the ID to the calculator's starting number of 0 but if i have it set to 8 is there a way to stop it if its not 0? I know its "If $oLink = _IEGetObjById($oIE,"cwos>0") Then" but i don't know what i can replace it with. here is part of the code. #include <MsgBoxConstants.au3> #include <GUIConstants.au3> #include <IE.au3> $oIE = _IECreate() _IENavigate($oIE, "https://www.google.com/#q=calculator&spell=1") _IELoadWait($oIE) sleep(1000) $oLink = _IEGetObjById($oIE, "cwos") ; $href = $oLink.href _IEAction($oLink, "click") If $oLink = _IEGetObjById($oIE,"cwos>0") Then MsgBox(16,"Error","Subtotal is not $0.00, halting!") Exit EndIf Link to comment Share on other sites More sharing options...
Solution corz Posted July 19, 2014 Solution Share Posted July 19, 2014 I *think* you are trying to do something like this.. $oLink = _IEGetObjById($oIE, "cwos") if $oLink.innertext > 0 then MsgBox(16,"Error","Subtotal is not $0.00, halting!") ;o) Cor blade 1 nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
blade Posted July 21, 2014 Author Share Posted July 21, 2014 Thanks for the help corz. Link to comment Share on other sites More sharing options...
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