Jump to content

Help with WEnd


CZorg
 Share

Recommended Posts

Hi all!

I'm completely new to AutoIt. I started using it yesterday and also made my first script yesterday. It was a script that launches World of Warcraft and logs you in, no typing passwords needed any more :P...

But today I got an idea because the server I'm on seems to disconnect often. The idea was a script that runs in the background if World of Warcraft is opened and when I disconnect I just have to press a certain key combination and the password is filled in for me and logs in to my account.

But the script I have so far gives me an WEnd error. Here's the script:

; Globals
$TextFileName = "launcher.ini"
$ProcessName = "wow.exe"

; Set hotkey to CTRL+ALT+R
HotKeySet("^!r", "MyRetype")

While 1
    Func MyRetype()
        $FileContents = FileRead($TextFileName)
        Send($FileContents)
        Send("{ENTER}")
    EndFunc
WEnd

; Exit if World of Warcraft is not running
if Not ProcessExists($ProcessName) Then
    Exit
EndIf

I don't see what's wrong whit how I'm using the WEnd. Help me...

Link to comment
Share on other sites

Thanks!

I also noticed that the end of my code didn't work

; Exit if World of Warcraft is not running
if Not ProcessExists($ProcessName) Then
    Exit
EndIf

So instead of set it to sleep in the loop I made it check if wow.exe was still running.

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