Jump to content

Problem with IE.au3.


Recommended Posts

When I'm trying to run a script that includes #include IE.au3 , I get this error.

Line 164 (File "C:\Program Files\AutoIt3\Include\IE.au3"):

Finc_IECreate($s_Url = "about:blank", $f_tryAttach = 0, $f_visible = 1, $f_wait = 1, $f_takeFocus = 1)

Error: "While" statement has no matching "Wend" statement."

Any help? :)

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You could post the part of your code that you think is causing the trouble for a start. :)

Nevermind, I got that working.

However, I am once again having trouble with another element -

Sleep(2145 + Random(1,2346))


      _IELinkClickByText($oIE,$charactername,0,0)

      Sleep(2145 + Random(1,2346))

      $level = StringSplit(_IEBodyReadText($oIE),@CR)
      $level1 = StringSplit($level[2],":")
      $level2 = $level1[2] - ")"

      Do
         $life = StringSplit(_IEBodyReadText($oIE),@Cr)
         $life2 = StringSplit($life[3],":")
         $life3 = StringSplit($life2[2],"/")
         Sleep(50)
      Until ($life3[1] + " ") = (" " + $life3[2])

      Sleep(100 + Random(1,543))
      _IELinkClickByText($oIE,"Enter Combat Arena",0,0)

      Sleep(2145 + Random(1,2346))

      _IELinkClickByText($oIE,"Fight This Opponent",0,0)

It logs into my character fine, but then never enters the Combat Arena. What am I doing wrong?

Also - the Sleep (2145 + Random(1,2346) will give me a sleep value that's at least 2.145 seconds and then randomly up to 5 seconds, correct?

Link to comment
Share on other sites

I have no idea what you are doing wrong, since I don't know the game. Try adding _IELoadWait($oIE) after the click by text... just a wild guess, really...

-edit:-

And yeah, the sleep part seems to do that alright.

Edited by Nahuel
Link to comment
Share on other sites

I have no idea what you are doing wrong, since I don't know the game. Try adding _IELoadWait($oIE) after the click by text... just a wild guess, really...

What would IELoadWait do?

And.. I'll link you to the game website, if you'd like to poke around a bit.

Edited.

Edited by Federalist
Link to comment
Share on other sites

I can't really help you.. I don't have an account there, I don't want to have one, I don't know the game, you are not giving useful information (like what exactly the problem is, the page source code, etc...).

Link to comment
Share on other sites

Sorry about that, I'll try to give some more useful information.

Edited out.

This is the page source code.

As for what exactly the problem is, I'm not sure. It logs in fine, and then just stops. It doens't print any errors, the script doesn't pause, it just ... doesn't execute the Click.

Edited by Federalist
Link to comment
Share on other sites

Oh, so the game runs in Shockwave player? If that's so, then _IeClickByText will never work. Run the script from SciTe, the function should say 'no match' in the console... right?

No, I'm pretty sure it's just a javascript page.

When I run it in SciTE, I get this

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\Avery\My Documents\test.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

+>20:28:46 Starting AutoIt3Wrapper v.1.9.4

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

+>20:28:46 AU3Check ended.rc:0

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Avery\My Documents\test.au3"

and it still stops at the same place.

Link to comment
Share on other sites

Oh... Javascript... I'm not an expert with it, but doing a simple _IENavigate has worked for me before... Something like: _IENavigate("www.server.com/common.js") or hover your mouse over the link and see what the status bar says... use that.

If that doesn't work, I'm clueless... Dale could probably help you.

Link to comment
Share on other sites

Oh... Javascript... I'm not an expert with it, but doing a simple _IENavigate has worked for me before... Something like: _IENavigate("www.server.com/common.js") or hover your mouse over the link and see what the status bar says... use that.

If that doesn't work, I'm clueless... Dale could probably help you.

Thanks for all your help, by the way.

What's curious about this is that while some of the links do exhibit the normal javascript tendencies (such as java script:getOnlineList()), rolling over the text that I'm trying to click simply says "Edit!"

Edited by Federalist
Link to comment
Share on other sites

I don't see any links in the HTML you posted (<a href=). One possibility is taht the Javascript being included is making dynamic changes to the page -- you can't see these with View Source. Another possibility is taht you are being confused by Frames.

In either case, please download and try DebugBar (free- see my sig) to get a view of the dynamically generated HTML and a better understanding of the HTML structure.

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

I don't see any links in the HTML you posted (<a href=). One possibility is taht the Javascript being included is making dynamic changes to the page -- you can't see these with View Source. Another possibility is taht you are being confused by Frames.

In either case, please download and try DebugBar (free- see my sig) to get a view of the dynamically generated HTML and a better understanding of the HTML structure.

Dale

Forgive my ignorance, but what exactly should I do with this ?

The HTML it prints out looks the same.

If I drag the little "find element" thing over what I'm trying to use , it says "function anonymous()

{

return doSubmitFunc()

}"

Not sure if I'm clicking the correct thing, however.

Also, when given the "Select a frame to validate" , it only gives me one option, so I'll assume there's only one frame?

And I'm 99.9% sure the javascript is making dynamic changes to the page - what I don't understand is how to make AutoIT cope with this.

txt += '<a href="#" onclick="showArena();return false">Enter Combat Arena</a><br>';

This seems more relevant - it was in the source code for "town.js", one of the scripts on the page.

Edited by Federalist
Link to comment
Share on other sites

I think you've not figured DebugBar out yet. You should not see a javascript function as the source for any elkement you can drop the bullseye on. You should see an HTML element.

For example, when I drop it on the final section of code in your last post I see:

<DIV class=codemain><!--ec1-->txt += '&lt;a href="#" onclick="showArena();return false"&gt;Enter Combat Arena&lt;/a&gt;&lt;br&gt;';<!--c2--></DIV>

DebugBar shows you the dynamically generated source by default - you have to work at it to see the original source.

If the DebugBar View Source drop-down shows only one item, then all you have is the main page and no frames.

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

I think you've not figured DebugBar out yet. You should not see a javascript function as the source for any elkement you can drop the bullseye on. You should see an HTML element.

For example, when I drop it on the final section of code in your last post I see:

<DIV class=codemain><!--ec1-->txt += '&lt;a href="#" onclick="showArena();return false"&gt;Enter Combat Arena&lt;/a&gt;&lt;br&gt;';<!--c2--></DIV>

DebugBar shows you the dynamically generated source by default - you have to work at it to see the original source.

If the DebugBar View Source drop-down shows only one item, then all you have is the main page and no frames.

Dale

Ah, I see.

When I drop it over the text that I'm tryign to use, I see

<A onclick="showArena();return false" href="http://ladderslasher.d2jsp.org/#">Enter Combat Arena</A>

What do I do from here?

Link to comment
Share on other sites

Ah, I see.

When I drop it over the text that I'm tryign to use, I see

<A onclick="showArena();return false" href="http://ladderslasher.d2jsp.org/#">Enter Combat Arena</A>

What do I do from here?

_IELinkClickByText($oIE, "Enter Combat Arena")

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...