Jump to content

Recommended Posts

Posted

you first need to confirm it is there, then you can send any command to that window

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Posted

Okay, so if I understand you correctly, I need to target the window so that AutoIt can confirm it's there? How would I go about doing this?

Sorry for the questions, I'm brand new to AutoIt :P

Posted

WinExist, read the help file it is one of the most resourceful things

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Posted

Okay, I think I got it now. What I'm trying to do is make the script loop endlessly. I checked here but am confused about which one would be used for my need.

Here's my script so far:

If WinExists("Element Client")
    Then
    Send{+[1]} ;targets party member #1
    Sleep("1000") ;waits a second
    Send{[F2]} ;change this to your hotkey for heal
    Sleep("1000")
    Send{+[2]} ;targets party member #2
    Sleep("1000")
    Send{[F2]} ;change this to your hotkey for heal
    Sleep("1000")
    Send{+[3]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
    Send{+[4]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
    Send{+[5]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
Posted

While 1
If WinExists("Element Client") Then
    Send{+[1]};targets party member #1
    Sleep("1000");waits a second
    Send{[F2]};change this to your hotkey for heal
    Sleep("1000")
    Send{+[2]};targets party member #2
    Sleep("1000")
    Send{[F2]};change this to your hotkey for heal
    Sleep("1000")
    Send{+[3]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
    Send{+[4]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
    Send{+[5]}
    Sleep("1000")
    Send{[F2]}
    Sleep("1000")
EndIf
Wend

By using while 1 (always true) it will continuously loop through the script. Also remember to close all open statements like your If (EndIf) and While (Wend).

Hope this helps,

Regards

Posted

CODE
While 1

If WinExists("elementclient") Then

Winactivate("elementclient")

Send{+[1]};targets party member #1

Sleep("1000");waits a second

Send{[F2]};change this to your hotkey for heal

Sleep("1000")

Send{+[2]};targets party member #2

Sleep("1000")

Send{[F2]};change this to your hotkey for heal

Sleep("1000")

Send{+[3]}

Sleep("1000")

Send{[F2]}

Sleep("1000")

Send{+[4]}

Sleep("1000")

Send{[F2]}

Sleep("1000")

Send{+[5]}

Sleep("1000")

Send{[F2]}

Sleep("1000")

EndIf

Wend

Posted (edited)

Take a look at this, I cleaned up your code a bit.

While 1
    If WinExists("elementclient") Then
        WinActivate("elementclient")
        For $i = 1 To 5
            Send("+{" & $i & "}")
            Sleep(1000)
            Send("{F2}")
            Sleep(1000)
        Next
    EndIf
WEnd

And about your first question, take a look at ControlSend().

AlmarM

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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
  • Recently Browsing   0 members

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