Jump to content

I Can't make this loop, nor will it open the file...


Recommended Posts

I've been in the process of making a script for Diablo II that would automatically move to a certain place, cast a spell, wait, return to the place it started from, and then loop the script. However, I don't understand the looping commands, so I tried the Run command. This is what my Run line looks like:

Run("VengeanceWaller_v1_0.exe", "[C:\Documents and Settings\Jackson\Desktop]", @SW_MAXIMIZE)oÝ÷ ÙÚç¶Z½ëayìZr×âéhq«b¢{(Ü(ºW[y«­¢+ÙIÕ¸ ÅÕ½ÐíY¹¹]±±É}ØÅ|À¹áÅÕ½Ðì°ÅÕ½ÐímèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈí)­Í½¸ÀäÈíͭѽÀÀäÈíY¹¹]±±É}ØÅ|À¹átÅÕ½Ðì°M]}5a%5%i¤

Any help would be greatly appreciated. I am reluctant to post the whole script, as I don't want my work stolen without credit being given to me.

Note: I have compiled the script so that it will open the .exe, I still have the original .au3 file toedit and mess around with.

Link to comment
Share on other sites

Loops are pretty basic...

While <something is true>
  ; do this
  ; then do this
  ; then do that
WEnd

Which will do all those things in the middle over and over and over as long as <something is true> is in fact true

I don't know what you are doing with your run command... but I fear you are trying to restart your script at the end of your script.... very bad idea.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

I was, in fact, trying to restart my script at the end of my script. I don't understand why it's a bad thing, but I'll take your word for it.

As to the loop, would an example be something like:

While <Diablo II is active>
Send("{Enter}starting in 5...{ENTER}")
Sleep(100)
Send("{ENTER}4...{ENTER}")
WEnd

How do I specify that it should loop while the Diablo II window is active?

Edited by KingVengeance
Link to comment
Share on other sites

See WinActive for a window.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

If that what the title bar says then yes. Understand that WinActive uses WinTitleMatchMode too.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

If that what the title bar says then yes. Understand that WinActive uses WinTitleMatchMode too.

Hey man thanks for the help, got it working perfectly, and now it loops indefinitely, which is exactly what I wanted

Spook, I thank you too, you guys were both a big help. Hopefully I get better at this as time goes on.

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...