someone Posted December 13, 2007 Share Posted December 13, 2007 (edited) Ha glad I could get it to work for you! It seemed as though you can't use on _IELoadWait (or rely on anything that waits for the the instance of IE to finish loading, hence you need IELinkClickByText($oIE,$charactername,0,0)) at all for the game page. Either live with a Sleep command, or work on finding another way to test if the page is finished loading. Good luck! EDIT: Didn't see you were having trouble with it moving on to another fight... I may check out the game but for right now I just joined to see if I could help, do me a favor and see if you can get anywhere on your own or at least reduce the code your having a problem with. If you can't get it I'll try to come back on and see if I can get it to work. Edited December 13, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
Nevin Posted December 13, 2007 Share Posted December 13, 2007 lol, nice avatar. You could always do a pixelsearch to see if some particular area loaded or something, then add a sleep. I think you could even do a checksum on an entire area. I've never tried that before, though.. Link to comment Share on other sites More sharing options...
Federalist Posted December 13, 2007 Author Share Posted December 13, 2007 lol, nice avatar. You could always do a pixelsearch to see if some particular area loaded or something, then add a sleep. I think you could even do a checksum on an entire area. I've never tried that before, though..Everything is loading , and I'm using sleep to make sure it does in fact load in time.However, after finishing the fight, it still hangs (without printing out an error message.) Link to comment Share on other sites More sharing options...
Federalist Posted December 13, 2007 Author Share Posted December 13, 2007 (edited) EDIT I think this is where the problem is - this is the code that deals with going to another fight, etc.. Edited December 19, 2007 by Federalist Link to comment Share on other sites More sharing options...
Federalist Posted December 14, 2007 Author Share Posted December 14, 2007 (edited) The problem is exactly Edit It just loops there nonstop. Is there a way to make it stop until EDIT the width of that is 100%? Because that represents the health bar. Or when EDIT Those two numbers are equal? Edited December 19, 2007 by Federalist Link to comment Share on other sites More sharing options...
Federalist Posted December 14, 2007 Author Share Posted December 14, 2007 So, is there a way to do this? Link to comment Share on other sites More sharing options...
Federalist Posted December 14, 2007 Author Share Posted December 14, 2007 func heal() do heal crap until $oStatsFrame = _IEGetObjById($oIE, "theframe") $statsClip = _IEDocReadHTML($oStatsFrame) StringInStr($Clip, "120/120") endfunc Someone PMed this to me. It did not work , and it's not what I'm really looking for. I just can't find any code that will call the HTML and sleep until it reads a "100%". Link to comment Share on other sites More sharing options...
someone Posted December 14, 2007 Share Posted December 14, 2007 (edited) func heal() do heal crap until $oStatsFrame = _IEGetObjById($oIE, "theframe") $statsClip = _IEDocReadHTML($oStatsFrame) StringInStr($Clip, "120/120") endfunc Someone PMed this to me. It did not work , and it's not what I'm really looking for. I just can't find any code that will call the HTML and sleep until it reads a "100%". Ha me someone? If I did I have to get more sleep because I don't remember that at all... but anyway, here this will work for you... Do Sleep(500) $oHP = _IEGetObjById ($oIE, "pHP") $HP = _IEPropertyGet($oHP, "innertext") $HP_WS = StringStripWS($HP, 8) $HP_Array = StringSplit($HP_WS, "/") _ArrayDisplay($HP_Array) Until $HP_Array[1] = $HP_Array[2] _IELinkClickByText($oIE,"Fight Another Level 1 Monster",0,0) You can add a MsgBox(0, "", $HP) if you want to see what it looks like before using stringsplit. I used stringstripWS to remove all whitespace in the "40 / 40" text. You may not need that but I thought that might avoid a problem down the road. From there, stringsplit splits "40/40" by "/". The loops ends when the first part of stringsplit (40) equals the second part (40). Run the code after you killed a monster while your health is regenerating to see it work. Hope this helps! Edited December 14, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
DaleHohm Posted December 14, 2007 Share Posted December 14, 2007 Per a previous question... can I tell when the text in a DIV represents equal values... I took your HTML and created an htm file and opened it in the browser... <HTML><TITLE>Foo</TITLE><BODY> <DIV class=statValue id=pHP>1592 / 1665</DIV> </BODY></HTML> Now study this code... #include <IE.au3> $oIE = _IEAttach("Foo") $oDiv = _IEGetObjById($oIE, "pHP") $sText = _IEPropertyGet($oDiv, "innertext") ConsoleWrite("InnerText of DIV = " & $sText & @CR) $quotient = Execute($sText) ConsoleWrite("quotient = " & $quotient & @CR) ConsoleWrite("Does quotient equal 1? " & ($quotient = 1) & @CR) Produces this output... InnerText of DIV = 1592 / 1665 quotient = 0.956156156156156 Does quotient equal 1? False Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Federalist Posted December 14, 2007 Author Share Posted December 14, 2007 Per a previous question... can I tell when the text in a DIV represents equal values... I took your HTML and created an htm file and opened it in the browser... <HTML><TITLE>Foo</TITLE><BODY> <DIV class=statValue id=pHP>1592 / 1665</DIV> </BODY></HTML> Now study this code... #include <IE.au3> $oIE = _IEAttach("Foo") $oDiv = _IEGetObjById($oIE, "pHP") $sText = _IEPropertyGet($oDiv, "innertext") ConsoleWrite("InnerText of DIV = " & $sText & @CR) $quotient = Execute($sText) ConsoleWrite("quotient = " & $quotient & @CR) ConsoleWrite("Does quotient equal 1? " & ($quotient = 1) & @CR) Produces this output... InnerText of DIV = 1592 / 1665 quotient = 0.956156156156156 Does quotient equal 1? False DaleThanks a bunch someone & Dale. And when I say "someone" pmed this to me, I meant some random person. Not you. XD I'll test those when I get home, but I have a VERY good feeling about both of them working. Stringsplit seemed a circuitous route to doing this - this seems a lot better. Link to comment Share on other sites More sharing options...
Federalist Posted December 15, 2007 Author Share Posted December 15, 2007 (edited) someone, you never cease to amaze. Your code worked wonders , and the entire thing works now. I was just wondering - if I wanted it to have three 'random options' , how would I do that? I know how to do it for two... EDIT But how do I do it for three? Like if I wanted random to be 1, 20 , 5, 1 ? Edited December 19, 2007 by Federalist Link to comment Share on other sites More sharing options...
Federalist Posted December 16, 2007 Author Share Posted December 16, 2007 (edited) edit Edited December 19, 2007 by Federalist Link to comment Share on other sites More sharing options...
BBock727 Posted December 17, 2007 Share Posted December 17, 2007 Bump.federalist , would u share this script? pm 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